Great article. Please also explain what happens to write through strategy if writing to cache succeeds and writing to database fails? In this case, after ttl, the actual data would be lost.
I would follow a strategy where I would write to the database first and if it is successful, write it to cache. Even if writing to cache fails, after ttl, read aside will take care of getting the latest data available from the database.
Good read
Nice one sir, Keep posting.
Good!
Well explained thank you
Great article. Please also explain what happens to write through strategy if writing to cache succeeds and writing to database fails? In this case, after ttl, the actual data would be lost.
I would follow a strategy where I would write to the database first and if it is successful, write it to cache. Even if writing to cache fails, after ttl, read aside will take care of getting the latest data available from the database.
Sorry I meant write around. Not write through
hey, for the write around strategy we only write to the database. Cache is updated during the read time similar to Cache Aside strategy