Cassandra
Định nghĩa
Cassandra là distributed wide-column database thường được dùng cho workload write-heavy, high availability, partitioned data và eventual/tunable consistency.
Cách hiểu bằng lời của tôi
Cassandra phù hợp khi dữ liệu có thể được model theo key/partition rõ ràng và hệ thống cần ghi rất nhiều với availability cao. Giá phải trả là phải thiết kế query theo access pattern, tránh partition quá rộng, hiểu compaction/SSTable, và chấp nhận consistency trade-off.
Pattern xuất hiện trong nguồn Netflix
- Viewing history: lưu time-series theo user, sau đó phải tách recent/old/historical vì row rộng và SSTable nhiều làm read chậm.
- Distributed counter: lưu raw event/rollup durable, kết hợp cache để đọc nhanh.
- Live Origin: dùng storage chunked và local quorum để bảo vệ write availability.
- Real-time graph: làm backend cho key-value graph storage qua namespace tách biệt.
Cần chú ý
- Hợp với write-heavy workload hơn read pattern tùy ý.
- Partition key và time bucket quyết định rất nhiều tới performance.
- Compaction, read repair và wide partition có thể thành bottleneck khi dữ liệu tăng.
- Cache như EVCache thường được đặt phía trước để giảm read load.