Batch Operations: Logged vs Unlogged
Learn the correct use cases for CQL batches and why batching is not a general-purpose performance optimization in Cassandra.
CQL supports BATCH statements to group multiple INSERT, UPDATE, and DELETE operations together. However, unlike batches in relational databases, Cassandra batches are not primarily a performance optimization — in fact, misusing batches is one of the most common Cassandra anti-patterns among developers coming from SQL backgrounds.
A logged batch is like a courier who writes a receipt listing everything they promised to deliver before setting out, so if they get hit by a bus halfway through, someone else can finish the deliveries from that receipt. An unlogged batch is just handing the courier several packages at once with no such receipt — faster to hand off, but no guarantee they'll all get delivered if something goes wrong.