Interview › Databases & Caching
What is read-your-writes consistency, and how can caching break it?
Databases & Caching · Advanced level
Answer
Read-your-writes means a user sees their own update immediately. Caching can break it by returning stale cached values or replica reads, so I bypass cache or invalidate/update it on write.
Technical explanation
Read-your-writes is strongest for the user who just performed the write.
Cache and read replicas can both break it immediately after update.
Solutions include delete/update cache on write, primary read after write, version checks, or short cache-bypass windows.
Hands-on example
Example:
PUT /profile updates RDS and deletes user:v2:123.
GET /profile for the same user during the next 10 seconds reads primary DB or rebuilt cache.
Public profile reads can remain cache-aside if stale reads are acceptable.
Check how well your resume matches the role with our free resume checker— match score, ATS check, and the skills you're missing.
More Databases & Caching interview questions
- What is Amazon RDS, and what does it manage for you versus self-managed databases?
- What database engines does RDS support?
- What is the difference between RDS and Aurora?
- What is Multi-AZ in RDS, and how does automatic failover work?
- How long does an RDS Multi-AZ failover typically take, and what triggers it?
- What is the difference between Multi-AZ and a read replica?
- When would you use a read replica, and can it become a standalone database?
- Can a read replica be in a different region, and why would you do that?