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.

Preparing for an interview?

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

← All Databases & Caching questions