Engineering Decisions · Middle · Question 2 of 14
After a transfer, the user opens their balance. The number must be exact, while the rest of the banking app reads from replicas. Where does this read go?
- 1To a read replica, showing a "may lag" note
- 2To the primary, with no cache in between
- 3To a cache that's invalidated after each transfer
Show the answer
Correct answer: To the primary, with no cache in between
Explanation
Money shown right after a write must reflect that write, and the primary is the one place that guarantees it. A replica fits lists and history, where a second of lag is harmless. A cache with invalidation fits frequently read data with rare writes, but a missed invalidation here would show a wrong balance, which costs more than the extra read.