liveBook · Manning

Partition

As explained in Grokking Software Architecture

A subdivision of a message stream that can be processed independently, with ordering guarantees limited to that subdivision.

In an event stream, a partition is a subdivision of a topic that lets multiple workers process events in parallel. Events with the same partition key go to the same partition, where one consumer processes them in order. That ordering guarantee does not extend across partitions. This differs from a network partition, which is a communication break between distributed nodes. section 7.4.2 section 2.9

Keep related events together

Use order_id as a partition key so events for the same order are routed to the same partition and processed in order. Do not assume events across different partitions have a global order. section 7.4.2

How Grokking Software Architecture covers it

How deep it goes
Defines routing by partition key and limits strict ordering to one partition, without detailing broker implementation.
Examples
Routes events sharing a customer_id or order_id to one partition and warns against assuming global order.
What you can do after
Build event-stream designs that route related events together and handle ordering without assuming a global sequence.
How it connects
Connects partitioning with message brokers, event-driven architecture, partition keys, consumer instances, and message ordering.

Also explained in

Compare how 4 books explain partition →

Related concepts

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