Skip to main content
databases

Database Types — SQL, NoSQL, NewSQL

15 min read
Fully authored

The taxonomy of database engines: relational, key-value, document, wide-column, graph, time-series, search, vector, and NewSQL — with when to pick each.

In 1970, Edgar F. "Ted" Codd at IBM published a paper titled "A Relational Model of Data for Large Shared Data Banks." It proposed something radical: instead of navigating pointers through hierarchical or network databases, express data as relations (tables) and query them with a declarative language (what SQL would become). For 35 years, this was the only real game in town. IBM DB2, Oracle, Sybase, Informix, SQL Server, MySQL, and PostgreSQL all inherited Codd's design.

Then, between 2006 and 2010, something broke. Google published the BigTable paper (2006). Amazon published Dynamo (2007). Facebook released Cassandra (2008). 10gen released MongoDB (2009). The engineers at these companies had hit a wall: their workloads needed global scale, and traditional SQL databases couldn't provide it without giving up availability. A wave of NoSQL ("Not Only SQL") databases was born, each specialized for a specific data shape: key-value, document, wide-column, graph, time-series, search, and later vector.

In 2012, Google published Spanner — showing that with careful engineering (atomic clocks, TrueTime, Paxos), you could actually have distributed ACID transactions at planetary scale. This kicked off the NewSQL era: CockroachDB, TiDB, YugabyteDB — databases that look like SQL to your application but scale horizontally like NoSQL underneath. Today the landscape has ~9 major database families with hundreds of products, and the "which database?" decision is genuinely the most consequential choice in most system designs.

The seminal papers

  • Codd (1970) — "A Relational Model of Data for Large Shared Data Banks." The paper that defined SQL databases. CACM.
  • Chang et al. (2006) — Bigtable: A Distributed Storage System for Structured Data. OSDI. Wide-column, LSM-based.
  • DeCandia et al. (2007) — Dynamo: Amazon's Highly Available Key-value Store. SOSP.
  • Corbett et al. (2012) — Google Spanner. OSDI. Launched NewSQL.
  • Kleppmann (2017) Designing Data-Intensive Applications. Kleppmann's book is the modern reference for the whole taxonomy.

The three big families

SQL
since 1970
Data as relations (tables). Declarative queries via SQL. ACID transactions.
Products
PostgresMySQLOracleSQL ServerSQLite
Strengths
  • Ad-hoc queries via JOIN
  • Strict schemas
  • ACID transactions
  • 50 years of maturity
Weaknesses
  • Vertical scaling ceiling
  • Schema changes need migrations
  • Struggle with unstructured data
NoSQL
since 2007-2010
7 specialized categories: key-value, document, wide-column, graph, time-series, search, vector. Purpose-built for specific data shapes.
Products
CassandraMongoDBRedisDynamoDBElasticsearchNeo4jPinecone
Strengths
  • Horizontal scale-out
  • Flexible schemas
  • Specialized for data shape
  • Massive throughput
Weaknesses
  • Weaker consistency (usually)
  • Category-specific limits
  • Hard to do ad-hoc analytics
NewSQL
since 2012+
SQL interface + ACID + horizontal scale via Paxos/Raft. The best of both worlds — at a cost.
Products
Google SpannerCockroachDBTiDBYugabyteDBVoltDB
Strengths
  • Distributed ACID
  • SQL queries
  • No manual sharding
Weaknesses
  • Higher latency than either
  • Operational complexity
  • Newer, less proven

Interactive: click any type to explore

Every serious database landing in one of 9 categories below. Click any to see: data model, query interface, real products, when to use it, and when to avoid it.

Database type explorer — 10 categories
SQL family
Relational (OLTP)
Data model
Tables (rows + columns) with foreign keys. Strong schema. ACID transactions.
Query language
SQL (SELECT, JOIN, GROUP BY)
Example syntax
CREATE TABLE users (id INT, name TEXT, email TEXT);
SELECT users.name, orders.total FROM users
JOIN orders ON users.id = orders.user_id;
Products
PostgreSQLMySQLOracle DatabaseMicrosoft SQL ServerSQLiteMariaDBIBM DB2Amazon Aurora
Good for
  • Transactional workloads (banking, orders, users)
  • Complex ad-hoc queries
  • Applications with relationships (JOIN)
  • Strong consistency needs
Bad for
  • Multi-region write scale
  • Very high write throughput (>50k/s per node)
  • Schemaless or nested-object data

SQL vs NoSQL — the fundamental split

The most-asked interview question of the last decade. The honest answer: NoSQL is not one thing — it's 7 different specialized categories. But the split from SQL matters because they make opposite trade-offs:

DimensionSQL familyNoSQL family
Data modelTables (rows + columns) with strict schemaDepends on subtype: keys, docs, wide-columns, graphs, time-series, text, vectors
Query languageSQL — standardized, powerful, JOIN-friendlyEach product has its own — CQL, MongoQL, Cypher, PromQL, ES Query DSL
SchemaEnforced at write time. ALTER TABLE for changes.Usually schemaless or 'schema on read' — each record can have different fields
ACID transactionsFull ACID within a database. Cross-shard is complex (2PC).Usually eventual consistency. Some products offer tunable (Cassandra CL) or bounded (DynamoDB TransactWriteItems).
JOIN queriesFirst-class — the whole point of the relational modelUsually not supported — denormalize instead, or use app-side joins
Horizontal scalingHard — vertical scaling first, then manual sharding (Vitess, Citus)Native — most were designed to scale-out from day 1
Consistency modelStrong (linearizable within a node)Usually eventual, sometimes causal, rarely strong
Best fit workloadOLTP (transactional). Small-to-medium ad-hoc analytics.High-write throughput, flexible schemas, specific data shapes
Maturity50+ years. Tooling galore.10-15 years. Tooling improving fast.
Team knowledgeEvery engineer knows SQLEach product is a learning curve

The SQL family — relational + columnar + NewSQL

SQL databases split into three subfamilies based on what they optimize for.

Relational OLTP
The classic. Transactional workloads.
Products
PostgreSQLMySQLOracleSQL ServerMariaDBSQLiteAmazon Aurora
Workload
Users, orders, payments, inventory. Anything that needs ACID + JOINs on modest data (< 10 TB per node).
Storage engine
B-tree indexes. Row-oriented. WAL for durability.
Columnar OLAP
Analytics warehouse. Read-optimized.
Products
Google BigQuerySnowflakeAmazon RedshiftClickHouseDuckDBFireboltApache Pinot
Workload
Data warehouse. Aggregations across billions of rows. Business intelligence dashboards.
Storage engine
Columnar files (Parquet-like). Vectorized query engine. Massive parallelism.
NewSQL (distributed ACID)
SQL + horizontal scale + ACID.
Products
Google SpannerCockroachDBTiDBYugabyteDBSingleStore
Workload
Global OLTP. Multi-region users needing ACID. Any workload that outgrew single-node SQL.
Storage engine
Distributed KV underneath (RocksDB or similar). Raft/Paxos replication. HLC clocks.

The NoSQL family — seven data shapes

NoSQL is where the taxonomy gets fun. Each NoSQL category is specialized for a specific data shape and access pattern. Pick the wrong one for your workload and you'll fight the database forever.

🔑
Key-Value
Fastest possible lookup by key.
Products
RedisDynamoDB (KV)MemcachedetcdRocksDBAerospikeRiak
Used for
Caches, sessions, rate-limit counters, config stores.
📄
Document
JSON docs. Flexible schema.
Products
MongoDBDynamoDB (doc)CouchbaseFirestoreCouchDB
Used for
Object-shaped data. Rapid prototyping. Apps where each record is a self-contained aggregate.
📊
Wide-column
Massive write throughput.
Products
CassandraScyllaDBGoogle BigtableHBaseAWS Keyspaces
Used for
Time-series, event logs, messages. Multi-region write-heavy. Netflix Cassandra clusters.
🕸
Graph
Many-hop relationships.
Products
Neo4jNeptuneArangoDBJanusGraphTigerGraphDGraphMemgraph
Used for
Social networks, fraud detection (money-flow rings), recommendation, knowledge graphs.
📈
Time-series
Millions of (t, value) points.
Products
PrometheusInfluxDBTimescaleDBVictoriaMetricsQuestDBGraphite
Used for
Metrics & monitoring, IoT sensors, financial tick data.
🔎
Search / Full-text
Inverted indexes + relevance.
Products
ElasticsearchOpenSearchSolrMeilisearchTypesenseAlgoliaVespa
Used for
Full-text search, log analytics, autocomplete, faceted search.
🧭
Vector (Similarity)
High-dim embeddings + ANN.
Products
PineconeWeaviateMilvusQdrantChromapgvectorRedis Vector
Used for
RAG for LLMs, semantic search, image/audio similarity, embedding-based recommendations.

The product landscape — real names, real categories

SQL — Relational OLTP
PostgreSQLMySQLMariaDBOracle DatabaseMicrosoft SQL ServerSQLiteIBM DB2Amazon AuroraAmazon RDSGoogle Cloud SQLAzure SQL
SQL — Columnar OLAP
Google BigQuerySnowflakeAmazon RedshiftClickHouseDuckDBApache PinotStarRocksFireboltDatabricks SQL WarehouseApache Druid
NewSQL
Google SpannerCockroachDBTiDBYugabyteDBSingleStoreVoltDBNuoDB
NoSQL — Key-Value
RedisAmazon DynamoDBMemcachedetcdRocksDBLevelDBAerospikeRiak KVKeyDBDragonfly
NoSQL — Document
MongoDBAmazon DynamoDBCouchbaseFirebase FirestoreApache CouchDBRavenDBMarkLogicAzure Cosmos DB
NoSQL — Wide-column
Apache CassandraScyllaDBGoogle BigtableApache HBaseAmazon KeyspacesAzure Cosmos DB (Cassandra API)
NoSQL — Graph
Neo4jAmazon NeptuneArangoDBJanusGraphTigerGraphDGraphMemgraphOrientDBNebula Graph
NoSQL — Time-series
PrometheusInfluxDBTimescaleDBVictoriaMetricsQuestDBGraphiteM3DBApache IoTDB
NoSQL — Search
ElasticsearchOpenSearchApache SolrMeilisearchTypesenseAlgoliaVespaSonicMeiliSearch
NoSQL — Vector
PineconeWeaviateMilvusQdrantChromapgvectorRedis + VectorVertex AI Vector SearchVald

Interactive: which database should I use?

Answer 4 questions about your workload. Get a recommendation. (This is a simplification — real decisions need more nuance — but it's a great mental starting point.)

Workload type
Data shape
Scale
Consistency need
Recommendation
PostgreSQL or MySQL
OLTP on one node. Postgres for feature-richness; MySQL for battle-tested simplicity.

Applied in real systems — who uses what for what

Every serious tech company runs multiple databases — one per data shape. Here are some real production choices.

Netflix
Deep dive

Netflix — a database for every job

Cassandra for viewing history and personalization (writes are king). DynamoDB for playback session state. EVCache (memcached) for the recommendation cache. Elasticsearch for the internal search across metadata. MySQL / Aurora for billing.

Read the deep dive →
Uber
Deep dive

Uber — MySQL + Cassandra + Postgres

MySQL for trip records (ACID, sharded via Vitess). Cassandra for driver locations (write-heavy). Postgres (Schemaless) for the internal document store. Presto for analytics. Redis for the ETA cache.

Read the deep dive →
Stripe
Deep dive

Stripe — Postgres + MongoDB

MongoDB for the primary transactional store (chosen in 2010, before NewSQL matured). Postgres for analytical workloads and newer services. Redis for rate limiting. Stripe famously wrote "Online migrations at scale" about moving data between engines.

Read the deep dive →
Instagram
Deep dive

Instagram — Postgres + Cassandra

Postgres for user accounts, relationships (sharded across thousands of instances). Cassandra for the feed and activity data. Memcached for read-heavy caching. Went from 1 Postgres instance to 5000+ over 5 years.

Read the deep dive →
Discord
Deep dive

Discord — Cassandra → ScyllaDB

Trillions of chat messages. Started on Cassandra 2016. In 2022 migrated to ScyllaDB (Cassandra rewrite in C++). Store partitioned by (channel_id, day_bucket). MongoDB for user metadata. Elasticsearch for search.

Read the deep dive →
Airbnb
Deep dive

Airbnb — MySQL + Presto + Druid

MySQL primary for listings, bookings (heavily sharded via Vitess). ElasticSearch for search (listings by location + filters). Druid for real-time analytics. Presto for offline analytics on the data warehouse.

Read the deep dive →
LinkedIn
Deep dive

LinkedIn — Espresso + Voldemort + Kafka

Built their own: Espresso (document DB on MySQL), Voldemort (Dynamo-clone key-value, open-sourced 2009), Ambry (blob storage), and famously Kafka (which grew far beyond LinkedIn). Now migrating some to PostgreSQL.

Read the deep dive →
Google
Deep dive

Google — BigTable → Spanner → F1

Bigtable for wide-column workloads (Search index, Analytics). Spanner for globally-consistent SQL (AdWords, Play). Firestore for mobile apps. BigQuery for analytics. Colossus for object storage. Every one was built at Google.

Read the deep dive →
Amazon.com
Deep dive

Amazon.com — DynamoDB + Aurora + Redshift

DynamoDB for shopping cart, session data (Amazon's own creation). Aurora (MySQL-compatible) for transactional workloads. Redshift for analytical warehouse. OpenSearch for product search. Neptune for personalization graphs.

Read the deep dive →
Pinterest
Deep dive

Pinterest — HBase + MySQL + Redis

HBase for the pin metadata (wide-column, write-heavy). MySQL (sharded, called "MySQL infra") for user data. Redis for the home feed cache. Elasticsearch for search.

Read the deep dive →
Figma
Deep dive

Figma — Postgres + custom LiveGraph

Postgres primary (heavily sharded). Built custom real-time collab layer called LiveGraph on top. Uses DynamoDB for OT operations queue. Elasticsearch for search across files.

Read the deep dive →
Modern RAG stacks
Deep dive

LLM apps — Vector DBs + Postgres

Every RAG (retrieval-augmented generation) system in 2024+ uses a vector database: Pinecone, Weaviate, Milvus, Qdrant, or simply pgvector for those on Postgres. Store embeddings, query by cosine similarity.

Read the deep dive →
Prometheus
Deep dive

Prometheus — the time-series standard

Every Kubernetes cluster ships with Prometheus for metrics. Custom TSDB (not general-purpose). PromQL query language. Pull-based scraping. Long-term storage typically offloaded to Thanos or VictoriaMetrics (S3-backed).

Read the deep dive →
Graph databases
Deep dive

Neo4j — fraud detection at banks

Neo4j is the market leader in graph databases. Used by UBS, eBay (fraud rings), NASA (mission planning), PayPal (money-laundering detection). Cypher query language is the standard for graph traversal.

Read the deep dive →

Key takeaways

  • 3 families: SQL (Codd 1970), NoSQL (2007-10 wave), NewSQL (Spanner 2012 onward).
  • SQL has 3 subfamilies: relational OLTP (Postgres, MySQL, Oracle), columnar OLAP (BigQuery, Redshift, Snowflake, ClickHouse), and NewSQL (CockroachDB, TiDB, YugabyteDB, Spanner).
  • NoSQL is 7 categories, not 1: key-value, document, wide-column, graph, time-series, search, vector. Each specialized for a specific data shape.
  • Trade-offs: SQL gives you flexible queries (JOIN, ad-hoc analytics), strict schemas, and ACID — within one node. NoSQL gives you horizontal scaling, flexible schemas, and specialized data models — but each category makes different consistency compromises.
  • NewSQL closes the gap: distributed ACID with SQL semantics. The 2020s default for globally-consistent OLTP workloads.
  • You will use multiple databases. Every serious tech company runs 3-8 databases in production, one per workload shape. Netflix, Uber, LinkedIn, Airbnb — all polyglot persistence.
  • The 4 decision questions: consistency requirement (ACID or eventual?), query shape (JOIN or point lookup?), scale (single node OK or must distribute?), data shape (rows, docs, keys, graphs, time-series, blobs, vectors?). Answer these → category becomes obvious.

References

  • Codd (1970) — A Relational Model of Data. CACM. The foundational SQL paper.
  • Chang et al. (2006) — Bigtable. OSDI.
  • DeCandia et al. (2007) — Dynamo. SOSP.
  • Corbett et al. (2012) — Spanner. OSDI.
  • Stonebraker & Cattell (2011) — "10 rules for scalable performance in simple operation datastores." A NoSQL-critical assessment.
  • Kleppmann (2017) Designing Data-Intensive Applications. Chapters 2-3 are the taxonomy reference.
  • db-engines.com — real-time ranking of databases by popularity. Great for seeing the landscape.

Practice what you just read

Every foundation concept has a companion quiz to close the loop.