Wide-Column Stores: Cassandra and ScyllaDB
Understand how Cassandra-style databases handle massive write volumes across many nodes and data centers.
Advanced · about 5 hours · difficulty 4/5
Learn first: NoSQL Families and When to Use Them
Apache Cassandra and its C++ reimplementation ScyllaDB are built for workloads that write enormous amounts of data and must stay available even when nodes or whole data centers fail: messaging history, IoT telemetry, activity feeds.
How it works
- Data is split into partitions by a partition key and spread around a ring of nodes using consistent hashing. Each partition is replicated to several nodes (the replication factor).
- There is no primary node: any node can accept writes, which makes it very available.
- Writes go to a commit log and memtable and are flushed to immutable SSTables that get compacted later, so writes are cheap.
Modeling with CQL
CQL looks like SQL but the rules differ. You design one table per query:
- The partition key decides which node holds the data; the clustering columns decide sort order inside a partition.
- No joins and very limited filtering. Duplicating data across tables is normal.
- Keep partitions bounded (for example bucket messages by conversation and month).
Tunable consistency
Each query picks a consistency level such as ONE, QUORUM or ALL. With replication factor 3, writing and reading at QUORUM gives you read-your-writes; using ONE is faster but may return stale data.
When not to use it
Small datasets, ad hoc analytics, workloads needing transactions across rows, or teams without the operational capacity to run a distributed database. Managed services (Astra, ScyllaDB Cloud, Amazon Keyspaces) lower that cost.
You are ready to move on when you can design a table for "latest 50 messages in a conversation" and explain what QUORUM means with replication factor 3.
Key concepts
- Partitions and consistent hashing
- Replication factor
- Partition keys and clustering columns
- Query-first table design
- Tunable consistency levels
- Compaction and tombstones
Mini project
Run Cassandra or ScyllaDB in Docker and model a chat app's message history with time-bucketed partitions, then query the latest messages per conversation.
Check yourself
Why is deleting lots of rows in Cassandra potentially bad for read performance?
Free resources
- Apache Cassandra documentation (Apache)
- ScyllaDB University (ScyllaDB)