Cassandra
What is it?
Cassandra is a distributed NoSQL database built to store huge amounts of data across many servers with no single point of failure.
Explain like I'm 5
Why was it created?
It was created to handle massive write-heavy workloads across many machines while staying available even when some servers fail.
Where is it used?
- Time-series and sensor data
- Messaging and activity feeds
- Large write-heavy systems
- Multi-region applications
Why should developers care?
Cassandra appears in large-scale systems needing high availability and write throughput, so it's valuable for senior backend and data roles.
How does it work?
Data is spread across a ring of nodes and replicated to several of them. Any node can accept reads and writes, and the cluster favors staying available, with consistency that can be tuned per request.
Real-world example
A messaging platform stores billions of messages across a Cassandra cluster spanning regions, surviving node failures without downtime.
Common use cases
- High write throughput
- Always-on availability
- Time-series data
- Geographically distributed data
Advantages
- No single point of failure
- Excellent write scalability
- Tunable consistency
- Linear horizontal scaling
Disadvantages
- Steep learning curve
- Limited ad-hoc querying
- Must model around queries up front
- Operational complexity
When should you use it?
When you need always-on availability and heavy writes across many nodes or regions.
When should you avoid it?
For complex queries, transactions, or small datasets where a relational database is simpler.
Alternatives
Related terms
Interview questions
Beginner
- What kind of database is Cassandra?
- Why does it replicate data?
Intermediate
- What does tunable consistency mean?
- Why design tables around queries?
Senior
- How does Cassandra fit the CAP theorem?
- How do you avoid hotspots in the partition key?
Common misconceptions
- "Cassandra is always consistent" — it favors availability, with consistency tunable per request.
- "You can query it freely like SQL" — you must design tables around your queries in advance.
Fun facts
- It originated from work at Facebook before becoming an Apache project.
- Its design borrows ideas from Amazon's Dynamo and Google's Bigtable papers.
Timeline
- 2008 — Open-sourced; later became an Apache project
Learning resources
Quick summary
Cassandra is a distributed NoSQL database offering high availability and massive write scalability across many nodes with no single point of failure.
Cheat sheet
- Distributed NoSQL, no single point of failure
- Great for heavy writes
- Tunable consistency
- Model tables around queries