← Library
Course · by Yash Tiwari

Databases: How each kind works, and when to use it

A tour of the database families (relational, key-value, document, wide-column, graph, search, time-series, columnar, vector and distributed SQL): how each stores data, what it is good and bad at, and the nuances of the main engines.

  1. 01

    Foundations

    What every database has to solve, whatever its type.

    0 / 10
    1. 1.1What a database is, and what it promisesSoon
    2. 1.2Data models and access patternsSoon
    3. 1.3Storage engines: B-trees and LSM treesSoon
    4. 1.4Indexes and how queries use themSoon
    5. 1.5Transactions and ACIDSoon
    6. 1.6Isolation levels and anomaliesSoon
    7. 1.7Replication and failoverSoon
    8. 1.8Partitioning and shardingSoon
    9. 1.9Consistency, CAP and PACELCSoon
    10. 1.10Durability: WAL, backups and recoverySoon
  2. 02

    Relational databases

    Tables, joins and transactions: the default for good reasons.

    0 / 6
    1. 2.1The relational model, SQL and normalizationSoon
    2. 2.2Query planning and reading EXPLAINSoon
    3. 2.3PostgreSQLSoon
    4. 2.4MySQL and InnoDBSoon
    5. 2.5SQLiteSoon
    6. 2.6SQL Server and OracleSoon
  3. 03

    Key-value stores

    One key, one value, very fast.

    0 / 6
    1. 3.1The key-value modelSoon
    2. 3.2RedisSoon
    3. 3.3MemcachedSoon
    4. 3.4DynamoDBSoon
    5. 3.5etcd and coordination storesSoon
    6. 3.6RocksDB and embedded enginesSoon
  4. 04

    Document databases

    Self-contained records with flexible shape.

    0 / 4
    1. 4.1The document model and when to embedSoon
    2. 4.2MongoDBSoon
    3. 4.3CouchDB and CouchbaseSoon
    4. 4.4FirestoreSoon
  5. 05

    Wide-column stores

    Write-heavy, partitioned by design.

    0 / 4
    1. 5.1The wide-column modelSoon
    2. 5.2CassandraSoon
    3. 5.3ScyllaDBSoon
    4. 5.4Bigtable and HBaseSoon
  6. 06

    Graph databases

    When the relationships are the data.

    0 / 3
    1. 6.1Property graphs, RDF and traversalSoon
    2. 6.2Neo4jSoon
    3. 6.3Graphs in SQL, and Amazon NeptuneSoon
  7. 07

    Search engines

    Finding text fast, and ranking it.

    0 / 3
    1. 7.1Inverted indexes and relevanceSoon
    2. 7.2Elasticsearch and OpenSearchSoon
    3. 7.3Solr and LuceneSoon
  8. 08

    Time-series databases

    Data that arrives in time order and is read in ranges.

    0 / 4
    1. 8.1Time-series workloads: retention, rollups and cardinalitySoon
    2. 8.2InfluxDBSoon
    3. 8.3TimescaleDBSoon
    4. 8.4PrometheusSoon
  9. 09

    Columnar and analytics

    Scanning billions of rows to answer one question.

    0 / 4
    1. 9.1Columnar storage, OLTP vs OLAPSoon
    2. 9.2ClickHouseSoon
    3. 9.3BigQuery and SnowflakeSoon
    4. 9.4Druid and PinotSoon
  10. 10

    Vector databases

    Nearest-neighbour search over embeddings.

    0 / 3
    1. 10.1Embeddings and approximate nearest neighboursSoon
    2. 10.2pgvectorSoon
    3. 10.3Pinecone, Milvus and QdrantSoon
  11. 11

    Distributed SQL

    SQL and transactions, spread across machines.

    0 / 4
    1. 11.1Why distributed SQL existsSoon
    2. 11.2SpannerSoon
    3. 11.3CockroachDBSoon
    4. 11.4TiDB and YugabyteDBSoon
  12. 12

    Choosing and operating

    Picking the right one, then living with it.

    0 / 5
    1. 12.1Choosing a databaseSoon
    2. 12.2Polyglot persistence and keeping stores in syncSoon
    3. 12.3Schema migrations without downtimeSoon
    4. 12.4Backups, restores and disaster recoverySoon
    5. 12.5Monitoring and slow-query tuningSoon