Read Replica Pattern
Problem: replication lag
Happens when Alice placed an order and immediately read the order history. In this case, the replica could have a slight lag which will not return the latest result.
In this case there are a few solutions:
- For latency sensitive read, delegate to master DB
- For
READ
that do immedately after aWRITE
action, query the master DB - If query data is outdated, we serve from the master DB first and then update the read replica after