Logged batches

Batches are atomic by default, also known as logged batches. Running a batch with logging enabled ensures that if any of the batch succeeds, all of it will.

Atomic batches use a new system table, batchlog, defined as follows:

CREATE TABLE batchlog (id uuid PRIMARY KEY,written_at timestamp,data blob);

When an atomic batch is written, the serialized batch is first written to the batchlog table as a data blob. After the rows in the batch have been successfully written (or hinted at), the batchlog entry is removed. The batchlog table is node-local, along with the rest of the system keyspace.

Get Learning Apache Cassandra - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.