Compare

Side-by-side on the decisions that recur: index vs scan, normalize vs denormalize, optimistic vs pessimistic, partition vs shard, and more — with when to choose each.

Cache-asideWrite-through
Who writes the cacheThe app, on read miss; deletes on writeEvery write goes through the cache
What gets cachedOnly what is readEverything written, read or not
ConsistencyA window between write and invalidationRead-after-write for cached rows
Write speedUnaffected (delete is cheap)Slower — cache + database synchronously
On cache failureApp still works (reads the DB)Writes are impacted
Choose this whenThe default: simple, resilient, caches only hot data — accept the invalidation discipline.Read-after-write consistency matters and write volume is modest.