Back to roadmap
Module 7 · NoSQL, Search, Graph, ObjectDay 06825 min

Choosing a Datastore

There's no 'best DB' — only best fit for the workload.

Day 068

Choosing a Datastore

Postgres
datastore
Redis
datastore
ES
datastore
S3
datastore
Memory hook

Choosing a Datastore: there's no 'best db'

Mental model

match the datastore to the access pattern

Design lens

Polyglot scales but adds operational diversity.

Recall anchors
WorkloadConsistencyPolyglot

Why it matters

Every datastore optimizes for a slice of the access-pattern × scale × consistency space. Pick by workload first; avoid hammering everything into one tool.

Deep dive

Map the dominant access patterns: read/write ratio, key shape, query shape.

Map the consistency needs: strong vs eventual.

Choose primary store per service; share through events, not shared DBs.

Demo / scenario

Rideshare platform.

  1. Trips/payments → Postgres (transactional).
  2. Driver locations → Redis geo (low-latency).
  3. Search → Elasticsearch.
  4. Events archive → S3 + Iceberg.

Tradeoffs

  • Polyglot scales but adds operational diversity.
  • Synchronization via events keeps systems decoupled.
  • Avoid sharing one DB across services — coupling kills you.

Diagram

Postgres
Redis
ES
S3
Polyglot persistence by service.

Mind map

Check yourself

Loading quiz…

Sources & further reading