2

I was wondering which cache solutions support Write-Through or Read-Through caching. I found out that Memcached only supports Cache-Aside caching and also that DAX supports Write-Through. I was wondering about more caching engines such as Redis etc. and couldn't find the answer.

THX

Guy Korland
  • 9,139
  • 14
  • 59
  • 106
G.Bar
  • 95
  • 1
  • 8

1 Answers1

1

Take a look at this project (https://github.com/RedisGears/rgsync) that uses RedisGears (https://oss.redislabs.com/redisgears/) to achieve Write-Behind and Write-Through on Redis.

Though it is not supporting Read-Through you can achieve it using RedisGears command reader (https://oss.redislabs.com/redisgears/readers.html#commandreader), just register a command that checks if the data exists on Redis, if its there then just return it. Otherwise, fetch it from wherever you want, save it on Redis, and return it.

Meir Shpilraien
  • 506
  • 2
  • 4
  • What you described in your second paragraph isn't an implementation of the read-through pattern. It is an implementation of the cache-aside pattern. It does provide a read solution, but not a read-through solution. – bopapa_1979 Jun 23 '21 at 22:53
  • It is read-through, RedisGears runs an embedded python interpreter, everything runs inside the Redis process (Recognize miss event, fetch the data and return to the client). The client is not aware if the data exists or was fetch, the client gets the data either way. Take a look at this https://github.com/RedisGears/rghibernate/tree/write_through_support, it uses RedisGears to implement a read-through. – Meir Shpilraien Jun 25 '21 at 13:28
  • my mistake and apologies. Cheers. – bopapa_1979 Jul 07 '21 at 20:36