Apache Cassandra

Cassandra is a distributed, wide-column NoSQL database designed for enormous write throughput and always-on availability across many nodes — even spanning data centers. There's no single primary; every node can take writes, which is what makes it so resilient and horizontally scalable.

The price of that scale is a different way of thinking: you model around your queries, not your entities. There are no joins, denormalization is the norm, and your partition key choices determine everything about performance.

TL;DR

Quick Example

A table is shaped by its primary key — a partition key (distribution) plus clustering columns (order within a partition):

Core Concepts

Data Modeling

Best Practices

Comparison: Cassandra vs DynamoDB

See DynamoDB.

Common Mistakes

Modeling relational workloads

Hot or unbounded partitions

FAQ

When should I use Cassandra?

For write-heavy, always-on, horizontally scaled workloads with known query patterns — time-series and event data per entity, high-volume ingestion, and geographically distributed systems. If you need joins, ad-hoc queries, or strong single-node consistency, a relational database fits better.

What are consistency levels?

They let you choose, per operation, how many replicas must acknowledge a read or write — e.g. ONE (fast, weaker) up to QUORUM or ALL (slower, stronger). This tunes the CAP trade-off between latency/availability and consistency for each query.

Why can't I do joins in Cassandra?

Joins require gathering data across partitions/nodes, which doesn't scale in Cassandra's distributed model. Instead you denormalize — store data pre-joined in tables shaped for each query you need to serve.

Cassandra or DynamoDB?

Cassandra if you want an open-source, self-managed (or multi-cloud) wide-column store with tunable consistency. DynamoDB if you want a fully managed AWS service with no cluster to operate. Both reward access-pattern-first modeling.

Related Topics

References