A payments service publishes ledger events for thousands of accounts and needs each account's events handled in sequence. What guarantee do Pub/Sub ordering keys provide?
Show answer and explanation
Answer: A
Ordering keys make Pub/Sub deliver messages that share a key in the order they were published, provided the publisher and subscriber are configured for ordering. Messages with different keys have no ordering relative to each other, which lets the service scale across accounts. Ordering keys do not supply a global sequence across the topic. Exactly-once handling and duplicate removal are separate features and are not implied by ordering keys.
Why the other options are wrong
- B. A global order across the whole topic is not what ordering keys provide. Messages with different keys can interleave, which is how throughput stays high while each account stays in sequence.
- C. Exactly-once delivery is a separate subscription setting. Ordering keys control sequence within a key and do not by themselves guarantee single delivery.
- D. Ordering keys do not deduplicate messages. Repeated publishes are not removed automatically, so consumers still need idempotent handling.