Advertisement
Interview Question
Users report that data they just wrote is not visible when reading immediately. Outline your investigation and mitigation.
Key Points to Cover
- Identify eventual consistency in DB/replicas or caches
- Check replication lag and cache invalidation
- Use read-your-writes/session consistency or stickiness
- Adjust TTLs and invalidate/write-through on updates
- Measure and alert on replication/caching delays
Evaluation Rubric
Diagnoses consistency model correctly30% weight
Handles caches/replication properly30% weight
Implements read-your-writes strategies20% weight
Adds metrics/alerts on lag20% weight
Hints
- 💡Sticky reads or session tokens help.
Common Pitfalls to Avoid
- ⚠️Assuming synchronous replication without verification.
- ⚠️Not considering the time it takes for cache invalidation to propagate.
- ⚠️Over-reliance on eventual consistency without implementing read-your-writes where critical.
- ⚠️Debugging only the database layer and neglecting the caching or application layers.
- ⚠️Not having adequate metrics or logging to diagnose replication lag or cache staleness.
Potential Follow-up Questions
- ❓When to use quorum reads?
- ❓What about dual writes?
Advertisement
Related Questions
Questions that share similar topics with this one
Design a URL Shortener (TinyURL)
Advanced🏗️ System Design•45 min•System-Design
Design a Global Distributed Rate Limiter
Advanced🏗️ System Design•45 min•System-Design
Design a Social News Feed
Advanced🏗️ System Design•45 min•System-Design
Design an E-commerce Checkout & Cart
Advanced🏗️ System Design•45 min•System-Design
Design a Distributed Caching Layer
Intermediate🏗️ System Design•30 min•System-Design