MongoDB vs Cassandra: Writes at Planet Scale
Learners will compare MongoDB's replica-set consistency model with Cassandra's tunable eventual consistency and leaderless replication for write-heavy IoT workloads.
Two Approaches to Distributed Data
MongoDB and Apache Cassandra both handle distributed data at scale, but with fundamentally different architectures. MongoDB uses a leader-follower (primary-secondary) model where writes go to a single primary per replica set. Cassandra uses a leaderless (peer-to-peer) model where any node can accept any write. This architectural difference drives every performance, consistency, and operational tradeoff between the two.
Cassandra's Leaderless Architecture
In Cassandra, all nodes are equal peers in a ring topology. A write can be sent to any node (the coordinator), which forwards it to the N replica nodes responsible for that row's partition key. The number of nodes that must acknowledge the write is configured by the consistency level (e.g., ONE, QUORUM, ALL). This architecture eliminates the single-primary bottleneck and enables truly multi-master, multi-region writes — every data center can accept writes simultaneously.
All lessons in this course
- MongoDB vs Redis: Documents vs Key-Value Cache
- MongoDB vs Cassandra: Writes at Planet Scale
- MongoDB vs DynamoDB: Cloud-Native Trade-offs
- When to Use a Graph Database Like Neo4j