Rushi
Rushi

Reputation: 1662

Storing MySQL writes in Memory

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 ?

Upvotes: 2

Views: 234

Answers (3)

Blizz
Blizz

Reputation: 8408

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.

Upvotes: 0

Your Common Sense
Your Common Sense

Reputation: 157890

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.

Upvotes: 1

Andy Lin
Andy Lin

Reputation: 545

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.

Upvotes: 0

Related Questions