SysDesign study
Offline — showing the cached copy.
Home / Software System Design / 5. Choosing a data store

5. Choosing a data store

One-liner. Match the access pattern, not the brand.

Memorize

  • Relational: transactions, joins, constraints — money, inventory, anything with invariants.
  • Key-value / document: known access paths, huge scale, flexible schema — sessions, catalogs, profiles.
  • Wide-column: time-series at write scale, predictable query keys.
  • Search: full-text, relevance, facets — usually a derived index, not the source of truth.
  • Blob: images, video, backups — object storage with a CDN in front.
  • Warehouse/lake: analytics, not OLTP — scanning columns over billions of rows.
POLYGLOT PERSISTENCE SOURCE OF TRUTH Postgres (order… DynamoDB (sessi… DERIVED OpenSearch (sea… Redis (cache) BLOBS S3 + CloudFront ANALYTICS Warehouse Iceberg lake
Polyglot persistence

Trap. Using a search index as the primary database — no transactions, reindexing loses writes. Do this. Name the query you must serve fastest; pick the store that makes it a key lookup.

Check

An app needs multi-row transactions for order + payment + inventory, with strong consistency. Which store fits?