← Lessons

quiz vs the machine

Platinum1880

Databases

The Calvin Deterministic Approach

Agree on the transaction order first, then let every replica execute that order independently with no commit time coordination.

6 min read · advanced · beat Platinum to climb

Order First Execute Later

Most systems coordinate while executing transactions, which makes distributed commit expensive. The Calvin approach inverts this. It first uses a sequencing layer to agree on a single global order of all transactions, then ships that ordered log to every replica. Because the order is fixed and execution is deterministic, each replica runs the same transactions in the same order and reaches the same state with no agreement at commit time.

Why Determinism Matters

If execution were nondeterministic, two replicas given the same order could still diverge. Calvin therefore forbids sources of nondeterminism inside transactions, such as reading the wall clock, so the ordered log fully determines the outcome.

What It Buys And Costs

  • There is no two phase commit and no blocking on a coordinator crash, because a replica only needs the agreed order to proceed.
  • Replication is cheap: ship the input log, not the results, and every replica recomputes.
  • The cost is that the full read and write set of a transaction must be known before sequencing, so transactions whose targets depend on prior reads need an extra reconnaissance step.

Key idea

Calvin agrees on a global transaction order up front and executes it deterministically on every replica, removing commit time coordination and blocking.

Check yourself

Answer to earn rating on the learn ladder.

1. What does Calvin agree on before executing transactions?

2. Why must Calvin transactions be deterministic?

3. What is a key cost of the Calvin approach?