Queues, Streams, Eventing
Message ordering: multiple-choice review
Six questions that cut across the whole unit. Each one mirrors a decision you make in a real incident — not a definition to recite, but a tradeoff to weigh when ordering and throughput pull against each other.
Confirm you can connect total-order cost, per-partition FIFO, partition-key choice, producer guarantees, and the production failure modes — the synthesis the lesson built toward.
Why is global total order across all messages fundamentally a throughput tax, not just a config flag you can flip on?
A wallet service emits credit then debit per account. It worked in staging with one consumer; in prod with eight consumers the debit sometimes lands first. What actually changed?
You need per-account ordering at high throughput on Kafka. What is the correct partition-key choice and why?
Which Kafka producer configuration can silently reorder two messages on the same partition?
A team grows a Kafka topic from 6 to 12 partitions to add throughput and immediately sees per-key ordering corruption. Why, and what is the standard avoidance?
A profile service consumes user.updated on an at-least-once queue with concurrent consumers; updates for one user occasionally arrive out of order or twice. What is the strongest design?
The through-line is one decision tree: total order needs a single serialization point and caps throughput, so you almost always want partial order — per-key FIFO. Choose the partition key as the entity that must stay consistent (accountId, userId). Order then breaks in three predictable places: a non-idempotent producer with multiple in-flight requests, a repartition that remaps keys, and at-least-once redelivery or DLQ replay. The durable design partitions by key and version-guards against the residual disorder.