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.

why NoSQL happened · LSM trees · Cassandra architecture · Cassandra data modelling · MongoDB architecture · MongoDB querying and indexing · MongoDB distribution · operating both · honest comparison · buildsenior → staff · engineers choosing or operating non-relational stores
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.
Built on the database coursesAssumes MySQL or PostgreSQL Internals and Distributed Systems (consistent hashing, quorums, consensus). Scaling Databases and Redis follow.