Menu

Why Cassandra fits high-frequency writes better than Postgres
📰

Why Cassandra fits high-frequency writes better than Postgres

DEV Community: postgres·Akhileshpm·7 days ago
#O5rZxSD1
#devtopostgresql#devto#dev#cassandra#writes
Reading 0:00
15s threshold

Imagine thousands of devices sending measurements every second. Each measurement is an independent write. Cassandra can handle this workload by spreading writes across servers and grouping disk writes on each server.

1. What happens to one measurement?

Cassandra · Commit log, memtable, SSTable

Append to commit log + update memtable → flush a batch to an SSTable

Each replica appends the measurement to its commit log and adds it to an in-memory structure called a memtable. If the replica crashes before a flush, it can replay durable commit log entries. The commit log sync settings control when those entries reach durable storage.

The memtable holds many writes. A flush writes them in sorted order to a new file called an SSTable. This is the write path of a log-structured merge tree, or LSM tree .…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.