There is a Facebook-based Flash game that pings the application server once a second to check the connection. The essence of ping is to write the timestamp in the database when the client was last connected.
One player - one request per second. But here are 10 thousand players, and somehow the resources of the database are wasted, 10 thousand times per second updating not particularly valuable data, which live less than a second.
While it occurred to me to connect memcache
(it happens on Heroku), and store / update player timers in it. Synchronize with the database once every N minutes already. As a separate worker, go over the cache, removing from it in the database the records of players who fell off more than 3 minutes ago, for example.
Surely, there are normal / best practices how to deal with this kind of task. Hint?