liveBook · Manning

Per-partition ordering

As explained in Kafka for Architects

Per-partition ordering is the sequencing guarantee that Kafka provides for records within an individual partition.

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

How Kafka for Architects covers it

How deep it goes
Explains global-versus-partition scope and key-based routing, without descending into implementation internals.
Examples
Uses customerId and caseId as message-key examples and contrasts ordered routing with round-robin distribution.
What you can do after
Configure Kafka partitioning around business identities when related events require sequencing.
How it connects
Connects Kafka topics, partitions, message keys, event-driven workflows, and throughput strategies.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Kafka for Architects. The section links point to the parts of the book it draws on.