Grokking the Advanced System Design Interview
Ask Author
Back to course home

0% completed

Vote For New Content
I was curious about what logical reasons a Producer would have for publishing to...

Camoen V

Sep 24, 2022

I was curious about what logical reasons a Producer would have for publishing to a single partition, rather than a single Topic. The example provided at https://codingharbour.com/apache-kafka/the-introduction-to-kafka-topics-and-partitions/ was helpful ("The link between a record and a partition").

Partitions maintain ordering, which is important for event ingestion in some scenarios. For example, if a user buys an item and then cancels their purchase, we want to ensure that these events are in order. In this case, the producer could use customerID as the key of the Kafka record, to ensure that both events go to the same partition (and then are consumed in order by the 'event consumer').

0

0

Comments
Comments

On this page