Per-partition ordering guarantees sequencing for records within one Kafka partition, not across an entire topic. Treat ordering as a business requirement before choosing a partitioning strategy. section 10.1.3
Use the ordering requirement to shape topic design:
- Preserve order where business logic depends on it by routing related events to the same partition. section 10.1.3
- Choose a suitable message key, such as customerId or caseId, when related events must remain ordered. section 10.1.3
- Use round-robin partitioning for higher throughput when ordering is unnecessary and partitioning will not break business logic. section 10.1.3
Routing events by business identity
A workflow requiring ordered events for each customer can use customerId as the message key, preserving sequence within that customer’s partition while avoiding a requirement for global ordering. section 10.1.3
