問題文
A team must decide the partition count for a new topic. Consumers will grow from two to possibly ten, and per-customer ordering must hold. What is the trade-off, and how should the design absorb it?
選択肢
- Choose enough partitions for the future parallelism and derive the key from the customer identifier, because ordering only holds within a partition and a customer's messages must therefore stay in one.
- Partition count does not matter because consumers can re-sort messages.
- Choose many partitions with no key, because more partitions always improve both throughput and ordering, and a customer's messages stay together automatically once the topic has enough partitions to spread the load.
- Choose one partition so ordering is guaranteed for the whole topic, and rely on adding consumers later because the platform distributes the messages of a single partition across the consumers of a group in the order in which they were produced.