views:

42

answers:

3

This is a bit of an oddball question. I'm aware of using memcached to cache "read heavy" data in memory, but is it possible todo the same for writes?

For example: You have a chunk of data in memory (in memcached) and if you have to make any changes to that data, you make it in memory itself. At the end of a certain time period (hour, or day) you replicate all those changes into MySQL. So you are using storing things in memory rather than disk, and then at the end of the time period those changes become permanent when they are copied over to MySQL.

Is there a piece of software that can accomplish this ? Sample code maybe ?

A: 

yes, it can be in that way to reduce I/O overload.

i believe what you described is a "write-behind" scenario for cache data.

the implementation can be done with creating task queues and setup workers to do the job.

Andy Lin
Is there some software that can implement this natively ?
Rushi
i don't know if there are software that do this natively, please let me know if you find one :Dhowever, this can be easily done with scripts, but do not use this tech for critical data
Andy Lin
+1  A: 

Not possible for the critical data, as memcache do not guarantee data consistency.

Though you can use such a behavior for the session data and no special software needed. Just retrieve your data, alter it and save back.

Col. Shrapnel
A: 

Perhaps MySQL Proxy can be of use for you? I haven't tried it so I don't know that it does what you require.

Blizz