Interview › Databases & Caching
What is the difference between strong and eventual consistency, and where does caching sit?
Databases & Caching · Advanced level
Answer
Strong consistency means reads reflect the latest committed write; eventual consistency means replicas or caches can be temporarily stale. Caches usually introduce eventual consistency unless reads bypass or refresh after writes.
Technical explanation
Caches can serve older values until TTL expiry or invalidation.
Read-after-write paths often need primary reads or synchronous cache invalidation.
Different data has different consistency tolerance: product descriptions differ from balances.
Hands-on example
Profile update flow:
UPDATE users SET name =... WHERE id = 123;After commit: DEL user:v2:123.
Return updated profile directly from the write response or bypass cache briefly for that user.
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
- How would you use Redis for distributed locking, and what are the caveats?
- How would you use Redis for rate limiting?
- What is the difference between Redis as a cache and Redis as a primary datastore?
- How do you decide what to cache and what not to cache?
- How do you handle cache warming after a restart or failover?
- Why are some Redis commands (KEYS, FLUSHALL) dangerous in production?
- What is the blast radius of a cache outage, and how do you make the app degrade gracefully?
- What is a cache hit ratio, and how do you improve it?