August 19, 2022·4 min read·engineeringcassandratransactionsaccord

Accord transaction syntax moves Cassandra beyond one partition

The August Cassandra changelog reports convergence on multi-key transaction syntax. CEP-15 explains the protocol work behind that syntax and why agreement on a language is only one part of the implementation.

Cassandra's work on general-purpose transactions addresses an awkward data modeling choice. Keeping related state together in one partition can simplify a conditional operation, but making that partition absorb every related update limits how the application distributes its work. Spreading the state introduces coordination that the application then has to manage.

The August 19 community changelog reports convergence in the discussion of syntax for multi-key transactions. Blake Eggleston has been drafting syntax for Accord as part of CEP-15. The same update describes Caleb Rackliffe's work on CQL support for multi-partition transactions. This is implementation progress, not an announcement that the facility is available in a stable Cassandra release.

The earlier CEP-15 proposal, revision 17, provides the design context. That revision predates this month's report. It proposes transactions operating over arbitrary keys, with strict serializability and low wide-area latency. Those are stated goals for development, and they explain why agreeing on a transaction language involves more than accepting a new arrangement of CQL statements.

I find this work interesting because it attempts to retain Cassandra's distributed character while reducing the coordination an application must implement itself. The application requirement still determines whether Cassandra is appropriate. A transaction facility would change the set of state transitions that the database can express directly.

A transaction needs both language and ordering

Syntax tells the database which reads and updates belong to one operation and how their conditions relate. A protocol must then establish an order that allows the operation to execute consistently across the participating replicas. A familiar-looking statement does not establish that ordering by itself.

CEP-15 identifies multi-partition conditional operations as a user-facing objective. It also separates broader user experience improvements from the initial protocol work. That division makes sense for implementation, but the two efforts must eventually agree on meaning. The language needs to identify the data on which an operation depends, and the execution system needs enough information to coordinate those dependencies.

The changelog describes a preference for SQL-congruent syntax in the CQL discussion. That preference concerns how users express the operation. It does not make Cassandra a relational database or settle the storage layout for an application. A language can reduce the effort of expressing a dependency while leaving the physical distribution of the underlying data as an architectural decision.

The record of convergence is useful because it narrows one source of uncertainty for implementation. Developers can align parsing and execution work around an agreed form. It should not be read as evidence that the protocol, failure handling, and integration have all reached the same level of completion.

Accord proposes timestamps and explicit dependencies

The historical proposal describes Accord as a leaderless timestamp protocol. A coordinator proposes a timestamp to replicas participating in a transaction. Replicas respond with information about conflicting transactions they have seen. The protocol uses that information to determine the execution timestamp and the dependencies that must precede execution.

In the proposed fast path, enough responses accept the initial timestamp for the transaction to use it. When that does not happen, the coordinator selects a higher timestamp from the responses and records it through an additional agreement step. The reason for recording the choice is recovery. If the original coordinator fails, another coordinator needs to determine which decision is valid.

That explanation connects latency to the information replicas already possess. A conflicting operation can prevent the initial timestamp from being accepted. The fallback is part of the protocol, not an instruction for the application to assume that every attempt completes with the optimistic number of messages.

Execution also depends on ordering the reads. The proposal describes replicas waiting for relevant dependencies before returning data to the coordinator. The coordinator combines those reads to compute an update, then disseminates the result. Agreeing on a timestamp and evaluating a transaction's logic are separate steps with a defined relationship.

This distinction matters for conditional changes. An update based on a read must use values consistent with the transaction's order. Merely sending the resulting writes to multiple partitions would not describe how the condition was evaluated relative to concurrent changes. The dependency handling supplies that part of the design.

The proposal separates fast agreement from failure assumptions

CEP-15 introduces fast-path electorates to describe which replicas may vote in that path. An electorate can be a subset of the full replica set. The proposal's argument relies on the necessary intersections between fast-path quorums and recovery quorums. Reducing the participating set is therefore constrained by correctness, not simply by choosing whichever nodes reply first.

It also proposes a reorder buffer. The described mechanism uses estimates of clock skew and communication latency to delay processing timestamp proposals. Processing those proposals in a suitable order is intended to increase the chance that replicas can accept the proposed timestamp on the fast path. The buffer is a specific part of the latency design, rather than a claim that clocks alone establish transactional correctness.

Recovery remains a separate responsibility. The proposal describes consulting replicas for the transaction state they have observed and continuing from the most advanced recorded stage. Ambiguous cases can require additional waiting or a slow-path decision. A useful account of the design must include that work alongside the optimistic agreement path.

The August milestone concerns implementation scope

The proposal calls for a standalone library developed alongside its Cassandra integration. It describes a prototype and a testing plan involving isolated randomized testing and verification within Cassandra. That structure permits the transaction protocol to receive focused testing while the database integration supplies the actual CQL and storage behavior.

I favor that separation because a protocol's correctness argument and an integration's correctness are related obligations with different failure modes. Syntax convergence helps connect them by giving the integration a clearer contract to implement. As of the August report, the concrete result is agreement in the language discussion and ongoing work toward multi-partition CQL support. The release status remains distinct from that design progress.