Pattern · seen in 2 breakdowns across 2 companies
Master-Only Reads
Send every read to the primary database, never to a replica (a copy that lags behind it), so no read is ever stale - replicas exist only for failover and backups.
The mechanism
At its core: a replica lags the primary, so a read from it can be stale - and for data that drives a decision, like whether a payment already happened, stale means wrong. Send every such read to the primary and the staleness bug simply cannot happen.
A retry reads a lagging replica, sees no charge, and charges again - read the primary instead and it never happens.
Definition
Send every read your production system makes to the primary database - the one that takes writes - and never to a replica. A replica is a copy that lags a little behind the primary, so reading one can hand back data that is slightly out of date. If no part of your application ever reads a replica, that staleness can never cause a bug. The replicas still exist, but only for failover, backups, and offline exports - never to serve live traffic.
This matters most for reads that drive a decision, not just a display. Some data exists only to control what the system does next, such as:
- has this payment already been charged?
- does another process already hold this lock or lease?
- has this exact message already been processed?
- is this username, seat, or order id already taken?
- is there enough balance to allow this withdrawal?
Read any of these from a lagging replica and you can get the wrong answer - the idempotency record that was just written looks absent, so the payment runs a second time. The very state that exists to prevent a mistake, read stale, causes it.
The usual reason to read from replicas is to spread read load, accepting a little staleness as the price. Master-only reads refuse that trade for correctness-critical data, and get the lost read capacity back a different way - usually by sharding the primary, which is why the two moves tend to go together. Keep this rule where staleness would change a decision; where a read only feeds a display, a slightly stale replica is fine.
When it applies
Tradeoffs
The same move, 2 ways
Every row is a production system that bet on this pattern — the note says how, in that system's own terms.
Problems this pattern answers
The walls where its breakdowns live — each opens the cross-company comparison.