

Ask HN: How do you track user data? - alexk

I've found that there are 2 types of user's data:<p>the one that changes not often  - user name, address, etc. and DB is the perfect place to store, search and update it,<p>and the other one that changes very frequently - recent requests history, menu and page state, etc. This type of data often has complex hierarchical structure (like tree control state) and can be updated very frequently. Do you use DB or some in-memory cache that is committed to the storage from time to time, are there any pitfalls that you've faced?<p>I'm thinking to use memory cache for this data and a daemon that commits this data to disk from time to time.<p>I've been using sessions (PHP sessions) to solve this task, but I plan to reject this approach for the following reasons:<p>1. want to have total control over user's data - storing, caching, protecting<p>2. want to share the data between multiple servers<p>Any ideas or advices?
======
mdasen
For #2: You simply need to change the session store in PHP. You can easily
make PHP sessions database backed.

