Skip to main content
InterviewHubPRO
Section Overview
Q48

Question 48 of 50

Part 3: Advanced Internals, Scale & Production Patterns (Senior / Lead)

96%
SQL & Relational Databases (50 Qs)•Part 3: Advanced Internals, Scale & Production Patterns (Senior / Lead)

Primary-Replica Topology and Replication Lag Mitigation.

senior Levelsql-databasesAdvanced Internals

In Simple Words:

  • Primary handles all WRITE operations and streams changes to Read Replicas.
  • Replication Lag: Asynchronous replication introduces a delay ($\Delta t \approx 50\text{ms} - 5\text{s}$) where replicas lag behind the primary.
  • Read-Your-Own-Writes Pattern: If a user updates their profile, route that specific user's reads to the Primary database for the next 5 seconds (or until replica LSN reaches the commit LSN), while routing anonymous traffic to read replicas.