Hi,

On all examples I could find of using memcached it is used as query
result cache. This means that all data manipulations and updates are
done on the db level and not in memory.

On applications with many updates, it seems to be much more efficient
to update the memcache object and write it to the db periodically with
a background process.

I couldn't find any information on how to do this on PHP/Mysql
configuration.

In pseudo code:

is user data in cache?
if not check if user data in database. if so fetch it.
if user data is not in the database/cache create PHP object
representing user data row with default values.
update user data

once in 10 minutes write all updated users data to database.

I tried to implement it on a rather complex user data and found its
complicated to create the object and write it to the db.
Has anyone done it automatically?
Some of the issues that have to be tackeled:
1.Creating empty user data object from mysql .
2.Writing the data back to the database from the data object.

Any help is very much appreciated.


Reply via email to