Member-only story
Consistency between Cache and Database, Part 2

- Part 1: Read Aside Caching
- Part 2: Enhanced Approaches
This is the last article in the series. In the previous article we introduced why caching is needed and also introduced the Read Aside process and potential problems, and of course explained how to improve the consistency of Read Aside. Nevertheless, Read Aside is not enough for high consistency requirements.
One of the reasons why Read Aside can cause problems is because all users have access to the cache and database. When users manipulate data at the same time, inconsistencies occur due to various combinations of operation order.
Then we can effectively avoid inconsistency by limiting the behavior of manipulating data, which is the core concept of the next few methods.
Read Through
Read Path
- Reading data from cache
- If the cache data does not exist
- Read from database by cache
- Cache returns to the application client
Write Path
- Don’t care, usually used in combination with Write Through or Write Ahead.
Potential Problems