Home›Learn›Database families
Families · the database landscape

Database families

Which kind of database fits which kind of traffic?

You will learn: the ten families of databases you meet in production stacks, how each one stores data, and the traffic that makes each one shine or struggle.

The rest of this site goes deep on PostgreSQL, MySQL and MongoDB, with full pages on Redis, Cassandra and vector search too. This page steps back. When someone asks me which database to use, I do not start from a product name. I start from the traffic: how much is written, how it is read, and what a lost write costs. The storage layout decides the rest.

At a glance

The layout decides the traffic it can take

Three ways to lay out the same data

The layout decides which traffic is cheap. Full tables below.

B-tree (PostgreSQL, MySQL, MongoDB)

rootbranchbranchbranchleaves: rows or keys, in order

A lookup walks root, branch, leaf: a few pages at any size. Changes update pages in place.

LSM tree (RocksDB, Cassandra)

memtable (RAM)L0: flushed filesL1: mergedL2: bigger, oldercompaction

Writes land in memory, then flush as sorted files. Compaction merges them in the background.

Column store (ClickHouse)

skuqtypricenotea query on sku and qty reads only those files

Each column is its own compressed file. Reports read only the columns they name.

FamilyWritesPoint readsBig scansTypical job
B-tree row storeGoodVery goodFairThe application database
LSM-tree storeVery goodGoodFairHigh write rates, append-heavy data
Column storeBatches onlyPoorVery goodAnalytics and reporting
In-memory key-valueVery goodVery goodPoorCache, sessions, counters
Document storeGoodVery goodFairVaried records read as a whole
Distributed SQLGood, slower per commitGoodFairScale and survival past one primary
Shared-storage cloudGood, one writerVery goodFairManaged relational with fast failover
Search engineFairGoodGood for textFull-text and log search
Vector searchFairApproximatePoorSimilarity search for AI features
Time seriesVery good, in time orderFairGood by time rangeMetrics and events

These ratings are my rule of thumb for each family as a whole. Individual products move between columns, and the right configuration moves them further.

One card per family

How each one stores data, and what hurts it

B-tree row stores

PostgreSQL, MySQL InnoDB, Oracle, SQL Server. MongoDB WiredTiger also keeps B-trees.

How it stores data
Rows live in fixed-size pages (8 KB in PostgreSQL, 16 KB in InnoDB). Indexes are B+ trees, so a lookup reads a handful of pages at any size. Every change goes to a write-ahead log first.
Traffic it handles well
A mix of reads and writes, lookups by key, joins, transactions with constraints. This is the default shape of an application database.
Traffic that hurts it
Very high insert rates with random keys, because each insert may dirty a different page. Huge scans for analytics, because every column of every row is read.
What I watch
Cache hit ratio, index bloat, the size of the log between checkpoints.

LSM-tree stores

RocksDB, Cassandra, ScyllaDB, MyRocks. CockroachDB and TiKV use LSM engines underneath.

How it stores data
Writes go to a memory table and a log, then get flushed as sorted, immutable files. Background compaction merges the files. A delete is a marker (a tombstone) until compaction removes it.
Traffic it handles well
Heavy, steady writes. Appends and time-ordered data. Writes are sequential on disk, which is what disks and SSDs like.
Traffic that hurts it
Reads that must check several levels of files (bloom filters reduce this). Workloads with many deletes, which leave tombstones behind. Compaction competes with your queries for I/O, so latency can spike.
What I watch
Compaction backlog, read and space amplification, tombstone counts.

Column stores

ClickHouse, DuckDB, BigQuery, Redshift, Snowflake.

How it stores data
Each column is stored separately and compressed. A query reads only the columns it names, often a tiny share of the data.
Traffic it handles well
Analytics: sums, counts and group-bys over billions of rows. Dashboards and reports.
Traffic that hurts it
Updating or reading single rows. Many small inserts, which most of these engines want batched.
What I watch
Insert batch size, the number of parts or files waiting to merge, and how many columns each query touches.

In-memory key-value

Redis, Valkey, Memcached.

How it stores data
All the data lives in RAM. Redis can also write a snapshot or an append-only file to disk. Memcached keeps nothing on disk.
Traffic it handles well
Sub-millisecond reads and writes by key: caches, sessions, rate limits, counters, queues.
Traffic that hurts it
Data larger than memory. Redis runs commands on one main thread, so one slow command, such as KEYS on a big keyspace or a long script, makes every other client wait.
What I watch
Memory use against the limit, the eviction policy, slow-log entries.

Document stores

MongoDB, Couchbase, Firestore.

How it stores data
Each record is a document, such as BSON in MongoDB, stored whole. Related data that is read together is kept together in one document.
Traffic it handles well
Records whose shape varies, data read as one unit, and horizontal scale through sharding.
Traffic that hurts it
Relationships across many collections, and documents that grow without bound, such as an array that keeps getting longer.
What I watch
Cache pressure, the oplog window, document size growth. See the MongoDB page.

Distributed SQL

CockroachDB, Google Spanner, YugabyteDB, TiDB.

How it stores data
Tables are split into ranges. Each range is copied to several nodes and kept in agreement with a consensus protocol (Raft or Paxos). SQL and transactions sit on top.
Traffic it handles well
Data and traffic too big for one primary, and the need to lose a node, or a zone, without losing writes.
Traffic that hurts it
Latency-sensitive single writes, because each commit waits for a majority of copies. Transactions that touch many ranges. Spreading one table across regions without thinking about where its rows live.
What I watch
Commit latency, how often transactions retry, and where the leaders of hot ranges live.

Shared-storage cloud databases

Amazon Aurora (MySQL and PostgreSQL compatible), AlloyDB, Neon.

How it stores data
Compute and storage are separate. The database sends its log to a storage layer that keeps several copies across zones. Aurora, for example, keeps six copies across three zones and needs four of them for a write.
Traffic it handles well
Fast failover and read replicas that share one copy of the data. Storage that grows without you managing disks.
Traffic that hurts it
It still has one writer, so it does not remove the ceiling of a single primary for writes. I/O-heavy workloads can be expensive, depending on the pricing model.
What I watch
Replica lag, I/O cost on the bill, and failover time measured in practice, not taken from the brochure.

Vector search

pgvector in PostgreSQL, Milvus, Qdrant, Pinecone, MongoDB Atlas Vector Search.

How it stores data
Each item is a list of numbers (an embedding). Indexes such as HNSW find near neighbours approximately, trading a little accuracy for speed.
Traffic it handles well
Similarity search for AI features: semantic search, recommendations, retrieval for chat.
Traffic that hurts it
Exact answers, very large collections on small memory, and frequent updates to an HNSW index, which are expensive to apply.
What I watch
Recall against an exact search, index build time, memory per million vectors.

Time-series databases

TimescaleDB, InfluxDB, Prometheus.

How it stores data
Data is partitioned by time. Old partitions are compressed, rolled up, or dropped whole.
Traffic it handles well
Metrics and events written in time order and read by time range.
Traffic that hurts it
Updates to old data, and very many distinct series (high cardinality), which explode index size.
What I watch
Series count, chunk or partition size, retention jobs.

For a whole application, with each kind of data placed and the reason given, see Application designs.

How I pick

Start boring, add a family when the traffic asks for it

  1. Start with one relational databasePostgreSQL or MySQL covers most applications for a long time. One system to back up, monitor and fail over is worth a lot.
  2. Add a cache when reads repeatRedis or Valkey in front of the database, for data that is read far more than it changes. Decide what happens when the cache is empty, before it is.
  3. Add a column store when reports slow down the applicationCopy the data out, through change data capture or batch loads, and let analytics run there.
  4. Add search when LIKE '%term%' shows up in the slow logKeep the database as the source of truth. The search index is a copy you can rebuild.
  5. Reach for distributed SQL or sharding lastOnly when one primary cannot take the writes, or the business needs to survive the loss of a region. Measure the commit latency you will pay first.

What I read for this page: the references list, especially Designing Data-Intensive Applications (2nd edition, Kleppmann and Riccomini) for storage engines and Alex Petrov's Database Internals for B-trees and LSM trees.

Check yourself · 3 questions

Check yourself

Pick an answer. You will see whether it is right, and why.

1. Which family suits heavy, steady, append-heavy writes?

2. Reports sum two columns over billions of rows. Which family?

3. Why can one slow Redis command make every client wait?

Part 1 of 4 · Learn · 23 pagesAll pages

How do databases actually work? From one row on disk to transactions: the words you need, PostgreSQL, MySQL and MongoDB from the files up, then Redis, Cassandra and vector search, side by side, and the query and concurrency traps.