AWS Developer DVA-C02 · Development with AWS Services · medium

A financial ledger uses Amazon SQS FIFO (First-In-First-Out) queues (orders.fifo) to guarantee strict message ordering and exactly-once processing within a 5-minute window. Multiple producer microservices publish order events for thousands of different customers (CustomerId). If every producer sets the exact same static MessageGroupId = "ALL_ORDERS" on every message, what performance bottleneck occurs, and how should MessageGroupId be designed instead?

Published · Last updated · checked before publication — how we verify questions

Options

  • AThe FIFO queue automatically converts itself into an Amazon SNS standard topic
  • BMessages serialize into one stream; set MessageGroupId = CustomerId for parallelismCorrect answer
  • CMessages sharing the same MessageGroupId are immediately dropped as duplicates
  • DSQS FIFO deletes messages older than 60 seconds when MessageGroupId = "ALL_ORDERS"

Answer: B. Messages serialize into one stream; set MessageGroupId = CustomerId for parallelism

In an Amazon SQS FIFO queue, MessageGroupId defines the boundary for strict ordering: SQS processes messages within the same MessageGroupId one batch/consumer at a time so order is preserved. Setting a single static MessageGroupId serializes the entire queue to a single active consumer stream. Setting MessageGroupId = CustomerId (high cardinality) preserves strict ordering per customer while allowing thousands of different customers' orders to be processed in parallel.

Why the other options are wrong

  • A. The FIFO queue automatically converts itself into an Amazon SNS standard topic — SQS FIFO queues never convert themselves into SNS topics.
  • C. Messages sharing the same MessageGroupId are immediately dropped as duplicates — MessageDeduplicationId (not MessageGroupId) controls 5-minute duplicate suppression.
  • D. SQS FIFO deletes messages older than 60 seconds when MessageGroupId = "ALL_ORDERS" — SQS retains messages up to the configured MessageRetentionPeriod (4 days default, up to 14 days).

All Development with AWS Services questions and the topic overview →

AWS and Amazon Web Services are trademarks of Amazon.com, Inc. PrepIQ Hub is not affiliated with, endorsed by, or sponsored by Amazon Web Services.