5

How is usually consistency maintained between DB and cache?

 3 years ago
source link: https://dev.to/bellawashington/may-rua-mat-loai-nao-tot-276
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

How is usually consistency maintained between DB and cache?

May 25

・1 min read

Say I have some documents in MongoDB and have cached a couple of fields in redis. If I were to update some value in both the DB and cache, I would like either both of them to succeed or both of them to fail. How is this problem generally handled?

If both the updates were to happen within MongoDB, I would use transactions. But, I presume that is not possible across two systems like MongoDB & redis.


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK