10 parts · 13 chapters
Cassandra and MongoDB
Two different bets against the relational model, taught together so the contrast is the lesson: Cassandra is wide-column, LSM-based and available-first; MongoDB is document-based, B-tree-based and tunable. Both are excellent at what they were designed for and painful when used as general-purpose relational databases.
Ten parts following the syllabus: why NoSQL happened; LSM trees as the shared foundation; Cassandra's architecture; query-first data modelling in Cassandra; MongoDB's architecture with BSON and WiredTiger; MongoDB querying and indexing; MongoDB replication and sharding; operating both; an honest comparison with Postgres and MySQL; and a capstone building an LSM engine, a document store and a consistent-hashing ring.
LSM treesMemtables, SSTables, compaction strategies and amplification.
CassandraRings, gossip, tunable consistency, repair, query-first modelling.
MongoDBBSON, WiredTiger, indexes and the ESR rule, aggregation pipelines.
distributionReplica sets, read and write concerns, sharding and shard keys.
operationsRepairs, compaction, index builds, backups, monitoring.
judgementWhen a document or wide-column store is the right tool, and when it is not.
00
Why NoSQL Happened
Two papers and a movement · The taxonomy and a decision matrix
2 ch · ~12 min01LSM Trees
Writes in memory, merges in the background · Compaction strategies and tombstones
2 ch · ~12 min02Cassandra Architecture
Leaderless, tunable, repaired
1 ch · ~8 min03Cassandra Data Modelling
One table per query
1 ch · ~8 min04MongoDB Architecture
Documents on B-trees
1 ch · ~8 min05MongoDB Querying and Indexing
Indexes and the ESR rule · Schema design: embed or reference
2 ch · ~12 min06MongoDB Distribution
Replication and sharding
1 ch · ~8 min07Operating Both
Runbooks for both
1 ch · ~8 min08An Honest Comparison
Choosing with mechanism, not fashion
1 ch · ~8 min09Build: LSM Engine, Document Store and Ring
Three builds
1 ch · ~8 minBuilt on the database coursesAssumes MySQL or PostgreSQL Internals and Distributed Systems (consistent hashing, quorums, consensus). Scaling Databases and Redis follow.