2

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 ?

Rushi
  • 1,652
  • 3
  • 17
  • 24
  • Do you have a write performance problem? And did you optimize your db-server for better write performance? Default configurations have a habit to be not be perfect... – Frank Heikens Aug 08 '10 at 11:45
  • Yeah its optimized for write, and i've gotten better HD's too. However I wanted to investigate this solution just as an alternative scenario. – Rushi Aug 10 '10 at 08:31

3 Answers3

1

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.

Your Common Sense
  • 156,878
  • 40
  • 214
  • 345
0

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
  • 545
  • 2
  • 4
  • Is there some software that can implement this natively ? – Rushi Aug 08 '10 at 10:02
  • i don't know if there are software that do this natively, please let me know if you find one :D however, this can be easily done with scripts, but do not use this tech for critical data – Andy Lin Aug 08 '10 at 10:20
0

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
  • 8,082
  • 2
  • 33
  • 53