← Lessons

quiz vs the machine

Gold1470

Concurrency

Ordering Guarantees

Compare the strength and cost of FIFO, causal, and total order delivery.

5 min read · core · beat Gold to climb

Why order matters

Messaging systems differ in how strongly they promise that messages arrive in order. Stronger guarantees make reasoning easier but cost coordination. The common levels form a ladder.

The ladder of orders

  • No order messages may arrive in any sequence. Cheapest, but the receiver must tolerate scrambling.
  • FIFO order messages from a single sender arrive in send order. It says nothing about messages from different senders.
  • Causal order if one message could have influenced another, the cause is delivered before the effect everywhere.
  • Total order every receiver sees all messages in the same single sequence, the strongest and most expensive.

Picking a level

Each step up adds coordination. FIFO needs only per sender sequencing. Causal needs dependency tracking. Total order needs agreement on one global sequence, often through consensus.

  • Pick the weakest order that keeps the application correct.
  • Over ordering wastes throughput and latency on guarantees you do not use.

Key idea

Ordering guarantees climb from none to FIFO to causal to total, each stronger and costlier, so choose the weakest level your correctness needs.

Check yourself

Answer to earn rating on the learn ladder.

1. What does FIFO order guarantee?

2. Which ordering is the strongest and most expensive?

3. What is the design advice on ordering levels?