Cards/KafkaSystem Design · Day 4Aug 4, 2026

Order Is A Choice, Not A Gift

Order Is A Choice, Not A Gift — system design card, day 4, kafka

Kafka does not keep your events in order. It keeps them in order in one place.

A topic is split into partitions. Ordering is guaranteed inside a partition — and nowhere else.

Which partition? hash(key) % partitions. No key, and Kafka just spreads them round-robin.

So "payment failed" can arrive before "payment started" — unless both carry the same key.

The fix is one line: key by the thing that must stay sequential. Account ID. Order ID. Not timestamp.

The catch: one key = one partition = one consumer. Order and parallelism are the same dial, pulled opposite ways.

Sequence isn't something you're given. It's something you decide to pay for.