Ordering, Exactly-Once and Durability
Harry
· 13 Sep 2026
· 1 views
Where Kafka Ordering Holds
Kafka guarantees order only within a partition. Records for one key share a partition, so per-key order is solid; cross-partition global order does not exist. Design consumers to rely on per-partition order.
Durability Chain
- Producer sends with acks=all.
- Leader writes to its log and waits for ISR.
- Followers replicate before acknowledgment.
- Consumer sees committed records only.
Retention vs Compaction
Topic retention (default 7 days) deletes old records by age. Log compaction instead keeps the latest value per key, ideal for key-value-like topics in event sourcing.
Exactly-Once Semantics
EOS combines an idempotent producer with transactions and read_committed consumers: the producer writes atomically across partitions, and consumers only see committed records, eliminating duplicates even on retries.
Key Points
- Order is per-partition, keyed and committed.
- acks=all plus ISR delivers durable writes.
- Compaction substitutes for retention on state topics.
- EOS needs transactions plus idempotence.