Skip to content
Tech Atlas, home
Search
Esc
  • All roadmapsBrowse every learning path
  • ExploreFind a technology area
  • ProjectsGuided projects and builds
  • My AtlasYour learning dashboard
Lesson 2 of 6 · Concept · 25 min · revision 1

Store families and what each is good at

Compare relational, key-value, document, wide-column, search, time-series, graph, vector, columnar and object stores by the reads they serve cheaply, their consistency options, query flexibility and running cost, then justify a choice against a rejected alternative.

Contentsand lesson path

What you will learn

  • Select a store family per dataset and justify it against at least one rejected alternative.

01. Why it matters

Each store family is a bet on certain shapes of read and write. A relational database bets that you will join and filter records in ways nobody planned. A wide-column store bets that you know your queries in advance and need to spread writes over many machines. Choosing well means matching the bet to the dataset cards from lesson 1, and saying clearly what you give up.

Two warnings before the tour. First, products blur the families: PostgreSQL stores JSON and, with an extension, vectors; DynamoDB is both a key-value and a document store. Reason by family first, then read the documentation of the product you would actually run. Second, no family is better in general. Every sentence below has an "if" attached, and the "if" comes from your cards.

02. Five questions to ask any store

Use the same five questions for every candidate:

  1. How is data addressed? By key, by key plus a sort order, by any column through SQL, by words, or by relationships.
  2. Which shapes are cheap, which are possible but expensive, and which are missing? A store can often answer a query it was not built for, but by reading far more data than the answer needs.
  3. What consistency can you get, and over what scope? Can one write change several records atomically? Do replicas and secondary indexes lag? Can you choose per request?
  4. How flexible are queries? Ad hoc SQL, or one table designed per query?
  5. What does it cost to run? Managed or self-run, backups and restore, upgrades, monitoring, the skills it needs, and every sync job that feeds it.

03. Stores for the records an app reads and writes

Relational databases (PostgreSQL, MySQL) keep rows in tables, enforce constraints such as foreign keys and unique values, and run multi-row transactions. SQL can join and filter in ways nobody planned, and secondary indexes make common filters fast. They fit data with relationships and invariants that span records: orders, payments, inventory, accounts. The limit is writing beyond one primary: growing past it means sharding, which makes joins and transactions across shards expensive and engine-dependent, though not impossible (see Database Scaling). PostgreSQL also stores JSON in a jsonb type with indexes, so "our data is JSON" is not by itself a reason to leave.

Key-value stores (Redis, Amazon DynamoDB, etcd) return a value for a key, very quickly and at high rates. Some add a sort key, so that one partition key holds an ordered range of items. They fit sessions, carts, feature flags and any lookup where the key is always known. Anything beyond the key needs a secondary index or a second copy. In DynamoDB, as documented in November 2026, an item holds at most 400 KB, reads are eventually consistent unless you ask for a strongly consistent read (not available on global secondary indexes), and a transaction covers at most 100 items.

Document stores (MongoDB, Couchbase, Firestore) keep JSON-like documents with nested fields and index any field. They fit aggregates that are read and written together, such as a listing with category-specific attributes or chat messages whose fields depend on their type. One document is updated atomically. MongoDB also runs multi-document transactions, and its documentation warns that they cost more than single-document writes and do not replace a good data model. A document holds at most 16 MiB.

Wide-column stores (Apache Cassandra, ScyllaDB, Google Bigtable, HBase) group rows by a partition key and sort them inside the partition by clustering columns. You design one table per query, and writes spread across many nodes. Cassandra lets each request choose how many replicas must answer (ONE, QUORUM, ALL), and Cassandra 5.0, the current release in November 2026, offers compare-and-set only within one partition. Ad hoc queries and joins are the weak spot. Partition keys and clustering covers the modelling.

04. Specialised stores, object storage and columnar stores

Search, time-series, graph and vector stores usually hold a derived copy fed from the primary store, so each one adds a sync path and a delay.

Search engines (OpenSearch, Elasticsearch, Apache Solr) build an inverted index from words to documents. They rank results by relevance, tolerate typos and count facets such as "128 results in clothing". New writes become searchable after a refresh: by default OpenSearch refreshes each shard every second while the shard is receiving searches. They are rarely the system of record. Search Indexing goes deeper.

Time-series stores (TimescaleDB, a PostgreSQL extension; InfluxDB; Prometheus for metrics) keep points ordered by time for each series. Compression and retention are built in, and many also downsample old data (keeping only hourly averages, for example). They fit metrics and sensor readings, not records that are updated or joined often.

Graph databases (Neo4j, Amazon Neptune) store nodes and edges and follow links many hops deep. SQL can do the same with recursive queries (WITH RECURSIVE in PostgreSQL), but the cost grows with each hop and with how many links each node has. Choose a graph store when the relationships are the question, as in fraud rings or recommendations.

Vector indexes find the items whose embeddings (lists of numbers that represent meaning) are closest to a query's. They exist as extensions (pgvector in PostgreSQL), as features of search engines (OpenSearch k-NN) and as dedicated databases. pgvector searches exactly by default; its approximate HNSW and IVFFlat indexes trade some recall for speed. Adding an index to a store you already run is often the first step.

Object storage (Amazon S3, Google Cloud Storage, Azure Blob Storage) keeps whole objects under keys, cheaply and durably, for anything from a few bytes to many gigabytes. S3 has given strong read-after-write consistency for writes and deletes since December 2020, but it cannot update several keys atomically, and listing keys by prefix is not a query. Lesson 4 covers it.

Columnar analytical stores (ClickHouse, BigQuery, Snowflake, Amazon Redshift, DuckDB) store each column separately and compressed, so an aggregate over billions of rows reads only the columns it uses. They fit reports and dashboards, but high rates of single-row updates or point lookups are not what they are built for. Inside a cloud warehouse explains the storage and billing model.

Summary · reads and atomic scope by family (check your product's docs)
family        reads it serves cheaply              atomic writes across records
relational    key, range, any indexed column,      yes: multi-row transactions
              joins, ad hoc SQL
key-value     key; range within a key (some)       limited (DynamoDB: up to 100 items)
document      key, indexed fields, nested data     one document; multi-document
                                                   transactions at extra cost (MongoDB)
wide-column   range within one partition key       compare-and-set within one
                                                   partition (Cassandra 5.0)
search        words, typos, relevance, facets      no; a derived copy of the record
time-series   time ranges per series, rollups      depends on the product
graph         multi-hop relationship traversal     depends on the product
vector        nearest neighbours by similarity     as the store that hosts the index
columnar      aggregates over billions of rows     batch loads, not row-by-row updates
object        whole object by key                  no; one key at a time

Read the table as a starting point, not a verdict. "Depends on the product" is a real answer: TimescaleDB inherits PostgreSQL transactions, while many time-series and graph products offer much less.

05. Justify the choice against a rejected alternative

A store choice is finished only when it names a rejected alternative and the reason. A good reason points at a line on the dataset card: an access pattern, a rate, an invariant, a staleness budget or a running cost. It also says under which condition the rejected option would win, so that the decision can be reopened on evidence rather than on taste. Here is the record for the scan events card:

Decision record · scan events
Dataset      scan_events (card from lesson 1)
Chosen       PostgreSQL, the engine the team already runs, on a primary of its
             own (parcels keep theirs); table partitioned by month so that old
             months can be exported and dropped
Because      R1 is a range within one key: index (parcel_id, scanned_at)
             R2 is a lookup by another attribute: index (depot_id, scanned_at)
             R3 is an aggregation with a one-day budget: nightly summary table
             about 560 writes/s at peak, append-only, no joins with other stores
Rejected     wide-column store (Cassandra-style), partition key parcel_id
Why not      it serves R1 well and spreads writes over many nodes, but R2 needs
             a second table keyed by depot, R3 needs an export job, and it adds
             a new kind of store to run, back up and monitor for a load one
             node carries
Revisit if   the scale check (lesson 3) shows a node limit within 18 months

Weak justifications are easy to spot. "Rejected PostgreSQL because SQL cannot handle JSON" is false. "Rejected MongoDB because NoSQL loses data" repeats an old story about one product's past default settings as if it described a whole family. "Chosen Cassandra because it scales" names no limit that was reached. Each fails because it does not point at the card.

06. Check your understanding

Practice check · 3 questions

Choosing and rejecting stores

Three new situations. Use the five questions and the cards, not the parcel example.

Q1. A help-desk app keeps 2 million tickets in PostgreSQL, and the team runs no other database. Agents want 'the 10 past tickets most similar in meaning to this one', limited to their own team. What is the most reasonable first design?
Q2. A four-person team runs one PostgreSQL database. A new audit log adds about 2 million rows (2 GB) a day, is kept for a year, and is queried a few times a week by user and time range. An engineer proposes adding Cassandra because 'logs need a write-optimised store'. What is the strongest assessment?
Q3. A user-profile dataset is read by user id, and a support tool filters profiles by country and plan. Which review note rejects an alternative with a sound reason?
Practice only: not graded, not saved, not evidence.

07. Apply it

Take your six marketplace dataset cards from lesson 1 and write a decision record for each, in the format above:

  1. The chosen family and product, and the card lines that decided it.
  2. At least one rejected alternative, with the card line it serves worse.
  3. The condition under which you would revisit the choice.
  4. For every derived copy (search, analytics, caches), the sync path and the delay it adds.

Then count the stores in your design and list the running costs each adds. If two datasets could share a store you already run without breaking a card, try that version too and compare.

08. Review prompt

Without looking back, answer in your own words:

  1. What are the five questions to ask any store?
  2. Which family fits a range within one key at very high write rates, and what does it give up?
  3. Why are search engines and vector indexes usually derived copies, and what does that cost?
  4. What makes a justification for rejecting a store sound, and what makes it weak?

References

Your progress

Reading state

Sign in to save that you finished reading this lesson.

Sign in to mark reading complete

Prove this skill

8 questions · about 6 minutes · scored automatically. Marking a lesson as read never demonstrates a skill.
Take the skill check