NoSQL families and the product map

Lesson 3.2 · 7 min read · by Vinay C

We'll cover the following

Visual summary

Infographic summarizing NoSQL families and the product map: In Choosing a database you decided what kind of store fits your data: a phone book, a bank, a search index. Now meet…

Download imageFree to share, please link back to this lesson.

From a type of database to actual products

In Choosing a database you decided what kind of store fits your data: a phone book, a bank, a search index. Now meet the products behind each type, so that in an interview you can say "Cassandra" or "DynamoDB" instead of just "a key-value store".

Five NoSQL families in one picture each

  • Key-value is a phone book: give a name, get a number back.
  • Document is a folder of JSON files: each file holds one whole object.
  • Wide-column is a giant sorted table split across many machines.
  • Graph is a map of relationships: who knows whom.
  • Search is the index at the back of a book: word to pages.
FamilyExamplesBest for
Key-valueDynamoDB, Redis, RiakLookup by key (URL shortener, sessions, cache)
Wide-columnCassandra, HBase, BigtableMassive writes, time-series, event logs
DocumentMongoDB, Couchbase, FirestoreSelf-contained JSON objects, flexible schema
GraphNeo4j, NeptuneRelationship traversal (friends of friends)
SearchElasticsearch, OpenSearch, SolrFull-text search, filters, log analytics

DynamoDB is key-value that can also hold documents. Cassandra is wide-column. Mongo is the true document store, but its sweet spot is flexible documents, not raw write throughput. Cassandra and DynamoDB are the write-heavy champions.

Relational and distributed SQL

  • Relational: Postgres, MySQL, MariaDB, Oracle, SQL Server, SQLite.
  • Distributed SQL: Spanner (Google), CockroachDB, YugabyteDB, TiDB.
  • Vitess is a sharding layer over MySQL (YouTube, Slack), not a database itself.
  • Aurora scales reads and storage well, but writes still go through one primary.

Google products mapped to the rest

Interviewers sometimes name a Google product. Translate it to its category and a cousin you know.

Google productCategoryCousin
Firestore (Datastore merged in)Document storeMongoDB, DynamoDB
BigtableWide-columnCassandra, HBase
SpannerDistributed SQLCockroachDB
Cloud SQL / AlloyDBManaged relationalPostgres, MySQL, Aurora
MemorystoreCacheRedis
BigQueryAnalytics warehouse (OLAP)Redshift, Snowflake

BigQuery scans billions of rows to aggregate (OLAP). The others serve app traffic (OLTP). This very app uses Firestore.

Elasticsearch / OpenSearch

Elasticsearch is a distributed wrapper (sharding, replication, REST API) around Lucene, which builds and queries an inverted index: each word points to the list of documents containing it. That is why search is fast, like finding a word through a book's index instead of reading every page.

  • Two jobs: user-facing search (product search, "search messages") and ops/log analytics (ELK, Splunk-style).
  • Never the source of truth. Postgres or DynamoDB holds the truth, and changes stream via Kafka or CDC into Elasticsearch as a searchable copy.

Wide-column: when and why

  • Time-series and events (IoT readings, metrics, logs): "all readings for sensor X, last hour".
  • Activity feeds and message history: "all messages in chat Y, newest first".
  • Huge write throughput with multi-region replication. There is no single primary: any node accepts writes.

Writes are fast because of the LSM-tree: append to memory, flush sequentially, no random seeks.

You model around the query. The partition key picks the node, and the clustering key sorts rows inside the partition. One query pattern, one table, and duplicates are fine.

Trade-offs: no joins, awkward reads outside the partition key, and tunable (eventual by default) consistency.

Key-value: Redis vs DynamoDB

RedisDynamoDB
StorageIn memory (fast, bounded by RAM)SSD-backed disk
LatencySub-millisecondSingle-digit ms
DurabilityOptional, weakerStrong, replicated
ScaleBounded by memory, clustering is more workPractically unlimited, auto-partitioned
RoleCache, sessions, rate limiters, leaderboardsPrimary database

Redis also has rich value types (lists, sets, sorted sets, counters). A common URL shortener setup: DynamoDB as source of truth, Redis in front for hot URLs.

Can a key-value store query by attribute?

Only in limited ways. Your options:

  • Scan: reads everything. Slow and costly, never on a hot path.
  • Secondary index (GSI): a second copy keyed by the field. Fast lookups, but extra storage and writes, and eventually consistent.
  • Sort key / range queries: partition key plus sort key, e.g. all orders for a user between two dates.
  • Ship to Elasticsearch for arbitrary filters and text search.

Rule: key-value works when you know your queries up front. The more ad-hoc the queries, the more you drift toward Postgres or Elasticsearch.

Check yourself

Check yourselfPick a store for each: (1) chat message history, (2) a login session cache, (3) product search with filters. Say why, and which one should never be your only copy of the data.

(1) Wide-column such as Cassandra: write-heavy, partition by chat, cluster by time so "newest messages in chat Y" is one partition read. (2) Redis: key lookup by session id, sub-millisecond, and losing it is tolerable. (3) Elasticsearch or OpenSearch: inverted index for text, filters and ranking. Elasticsearch must never be the only copy: keep Postgres or DynamoDB as the source of truth and stream changes in via Kafka or CDC.

Summary: say it in the interview

  • Six names cover almost every design: Postgres, DynamoDB, Cassandra, Redis, Elasticsearch, Spanner.