So I need to create a portal site, where we will require multiple frontends. As most portal's we need to store some state information inside a session. We also need to show how many users are online, but more importantly be able to filter searches in the member database by who is online (we do not need to filter by how long the last site interaction as been, but you never know with changing requirements).
Now in order to filter by users in the member search, we need to have some information about active sessions by user id inside MySQL database. But if we were to put the entire session data inside the database we would have to hit the master on every request to update the session timeout. More importantly we would have to deal with replication lag.
The alternative approach to working around replication lag is using memcache. But with memcache we would not have access to who is currently online in an easy queryable way when we are …
[Read more]