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.
Three ways to lay out the same data
The layout decides which traffic is cheap. Full tables below.
B-tree (PostgreSQL, MySQL, MongoDB)
A lookup walks root, branch, leaf: a few pages at any size. Changes update pages in place.
LSM tree (RocksDB, Cassandra)
Writes land in memory, then flush as sorted files. Compaction merges them in the background.
Column store (ClickHouse)
Each column is its own compressed file. Reports read only the columns they name.
| Family | Writes | Point reads | Big scans | Typical job |
|---|---|---|---|---|
| B-tree row store | Good | Very good | Fair | The application database |
| LSM-tree store | Very good | Good | Fair | High write rates, append-heavy data |
| Column store | Batches only | Poor | Very good | Analytics and reporting |
| In-memory key-value | Very good | Very good | Poor | Cache, sessions, counters |
| Document store | Good | Very good | Fair | Varied records read as a whole |
| Distributed SQL | Good, slower per commit | Good | Fair | Scale and survival past one primary |
| Shared-storage cloud | Good, one writer | Very good | Fair | Managed relational with fast failover |
| Search engine | Fair | Good | Good for text | Full-text and log search |
| Vector search | Fair | Approximate | Poor | Similarity search for AI features |
| Time series | Very good, in time order | Fair | Good by time range | Metrics 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.
PostgreSQL, MySQL InnoDB, Oracle, SQL Server. MongoDB WiredTiger also keeps B-trees.
RocksDB, Cassandra, ScyllaDB, MyRocks. CockroachDB and TiKV use LSM engines underneath.
ClickHouse, DuckDB, BigQuery, Redshift, Snowflake.
Redis, Valkey, Memcached.
MongoDB, Couchbase, Firestore.
CockroachDB, Google Spanner, YugabyteDB, TiDB.
Elasticsearch, OpenSearch.
pgvector in PostgreSQL, Milvus, Qdrant, Pinecone, MongoDB Atlas Vector Search.
TimescaleDB, InfluxDB, Prometheus.
For a whole application, with each kind of data placed and the reason given, see Application designs.
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.
Pick an answer. You will see whether it is right, and why.
1. Which family suits heavy, steady, append-heavy writes?
Writes go to memory and sorted files, which disks handle well. Compaction merges them later.
2. Reports sum two columns over billions of rows. Which family?
It reads only the two columns, compressed. Notebook 7 read 870,400 of 10 million rows in 8 ms.
3. Why can one slow Redis command make every client wait?
Each command is atomic for the same reason.
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.