Code RoomRead-replica routing layer
MediumPrep Room Coding #3772

Read-replica routing layer

System designDatabases & SQLNetworking & APIsMid–Senior~35 min

Design a read-replica and routing layer in front of a Postgres primary with 6 read replicas, handling a 95/5 read/write ratio at 100k QPS. Routing must send writes to the primary, spread reads across healthy replicas, and avoid the 'read-your-own-write' bug where a user updates a profile and immediately sees stale data. How do you route, track replica health, and handle replication lag?

What a strong answer looks like

Clarify scale and constraints first. Propose a clean component breakdown, then go deep on the hard parts (data model, bottlenecks, consistency, failure modes) and name the trade-offs you are making.

Clarify4:00 left
Estimate4:00 planned
Design11:30 planned
Deep dive9:30 planned
Failure6:00 planned
0:00
Which questions mattered is sealed until you submit. Telling you now would just be handing over the edge cases.