As asked
Users update their profile and immediately see old data because reads go to replicas. How would you fix this?
Sample answer outline
First confirm the symptom is replication lag by measuring primary commit time, replica replay lag, and the request path. Common fixes include read-your-writes routing to the primary for a short window after a write, session stickiness, or using a version token that waits until a replica has caught up. Do not route all reads permanently to the primary unless the capacity tradeoff is acceptable. Add lag-aware load balancing and alerts so unhealthy replicas stop serving freshness-sensitive reads. Strong answers define which reads require consistency and which can tolerate stale data.
Expect these follow-ups
- How would you expose read consistency requirements in an application API?
- What happens if replica lag is caused by one expensive analytical query?
- How does this differ in eventually consistent NoSQL stores?