Preserve the sequence that carries business meaning#
Order 42: Created → Paid → Shipped → CancelledRandomly sending these events to independent partitions can expose them out of expected order. Keying by order_id keeps one order in one partition, preserving partition sequence under the relevant broker and producer semantics.
| Guarantee | Scope | Cost |
|---|---|---|
| Global order | Every event | Coordination and limited parallelism |
| Partition order | One partition | No order across partitions |
| Entity order | One keyed entity | Hot entities and key discipline |
Retries, multiple producers, concurrent application handlers, and external side effects can still disturb observed business order.
Related practice problems
Use the manifest-backed prompts below to apply this lesson in a complete design.
- Apache Kafka introductionApache Kafka Documentation