Chandra
Database

Database

Comprehensive reference on database internals: taxonomy, indexing, storage engines, core algorithms, transaction concurrency, scaling, and deep dives into distributed databases.

Files

Overview

  • taxonomy.md — Database type classification: SQL, NoSQL, Document, Key-Value, Wide-Column, Graph, Object, Time-Series, NewSQL
  • indexing.md — Index fundamentals, B+Tree structure, composite index rules, per-engine indexing (PostgreSQL, SQL Server, MongoDB, Cassandra, Redis)
  • storage-engines.md — B-Tree, LSM-Tree, Heap, and Columnar: the fundamental storage structures with comparison table, page layout, tree topology, search/insert algorithms, and practical implications (fill factor, bloat, PK choice, columnar advantages)
  • algorithms.md — Cross-cutting algorithms: MVCC, Write-Ahead Log, Merkle Trees, Bloom Filters (with pseudocode)
  • concurrency-and-scaling.md — Transactions, isolation, locking, replication, scaling, distributed transactions, distributed consensus (Raft, Paxos, VSR), gossip protocol, consistent hashing
  • query-and-optimization.md — Query pipeline, scan methods, join algorithms, parallel execution, cost estimation theory, optimization heuristics
  • specialized-databases.md — Vector databases (pgvector, Pinecone, Milvus), Search engines (Elasticsearch), Embedded (SQLite, DuckDB), Streaming, Time-Series internals

Deep Dives (per database)

  • deep-dives/postgresql.md — Data model, heap storage, MVCC, WAL, indexes, query execution, replication, performance tuning
  • deep-dives/mysql-innodb.md — Clustered B+Tree, buffer pool, redo/undo logs, locking, MVCC, replication, query execution
  • deep-dives/sqlite.md — Manifest typing, B-Tree file format, page types, VDBE bytecode, WAL/journal, concurrency
  • deep-dives/sql-server.md — Page/extent architecture, B-Tree indexes, transaction log, buffer pool, query execution, replication
  • deep-dives/mongodb.md — WiredTiger engine, document model, aggregation, indexes, replica sets, sharding, change streams
  • deep-dives/redis.md — Data structures & encodings, persistence, replication, cluster, eviction, transactions
  • deep-dives/cassandra.md — SSTable structure, compaction, bloom filters, read/write paths, gossip, repair, LWTs
  • deep-dives/spanner.md — TrueTime, data model, directory-based sharding, interleaved tables, indexes, Paxos, 2PC, F1 SQL

Examples