Sorry for the naïeve question, but what's the point in storing small amounts of data in a database when you can store them in php memory instead? It seems like php memory is way faster than db queries.
Is it true that the server thread might die and another thread needs to be able to recover the state from the db?
Currently, I maintain a cached version of a db table in memory, and make insert/delete/update queries when information changes. To access information, I use the cache as long as it is defined. If not, I select all from the database to restore the cache.
Is this the proper way of doing it? How long does a cached object exist? The entire game? Just a single action? Do multiple independent server threads manage the php based on availability?
Is it true that the server thread might die and another thread needs to be able to recover the state from the db?
Currently, I maintain a cached version of a db table in memory, and make insert/delete/update queries when information changes. To access information, I use the cache as long as it is defined. If not, I select all from the database to restore the cache.
Is this the proper way of doing it? How long does a cached object exist? The entire game? Just a single action? Do multiple independent server threads manage the php based on availability?