FIFO, deduplication and broker selection
Choose ordering only where it matters
A FIFO queue preserves order within a message group. For example, order O-17 has events Created, Paid and Shipped; use the same MessageGroupId for this order if they must be processed in sequence. Another order O-18 can use a different group and make independent progress. Producers still must publish in the intended order, and consumers must preserve sequence within each group even when a batch contains multiple messages. One group for all orders can restrict parallelism. A standard queue is appropriate when independent jobs can arrive in any order and the handler is idempotent.
Deduplication does not guarantee one business effect
With SQS FIFO, repeated sends using the same deduplication ID within the applicable five-minute window are suppressed. Content-based deduplication, if enabled, derives the ID from the message body rather than its attributes. Use a distinct event ID per logical operation, not the order ID for every event. Example: O-17:Paid and O-17:Shipped must not share a deduplication ID. A repeated send outside the window may be accepted again. A consumer that committed a write and failed to delete can still receive the same message again. End-to-end idempotence remains necessary, even with FIFO.
Compare managed queues, topics and brokers
Choose SQS for a work backlog with workers pulling messages; SNS for broadcasting events to subscribers; combine SNS and SQS for independent buffered workflows. SNS also has FIFO topics for supported ordered delivery patterns; verify endpoint and queue compatibility. Amazon MQ manages brokers based on ActiveMQ Classic or RabbitMQ; consider it for existing applications that require a supported broker protocol, routing behavior or client library. Migrating to SQS is not merely changing an endpoint because acknowledgment, routing and client semantics differ. Compare broker availability, network reachability, maintenance, throughput and costs before deciding. A queue is not a permanent event history.
Design a safe recovery and cost plan
A FIFO DLQ may break the original sequence when a failed message is removed and later messages proceed. If order is a business invariant, define a per-group pause or reconciliation procedure before redriving. Use metrics for age, backlog and failed deliveries; set worker concurrency and retry bounds. Estimate request volume, payload size, retries, SNS delivery dimensions, encryption and network charges; broker pricing may include running capacity and storage. Use dated regional prices before a live lab. The offline exercise has no network access, recipients, credentials or AWS charges.
Practice: pick a messaging design
For independent thumbnail jobs, choose standard SQS with duplicate-safe writes. For per-order transitions that require sequencing, consider FIFO with one group per order and a unique event ID. For packing plus analytics, use SNS fan-out to separate queues. For an existing RabbitMQ application with required AMQP behavior, evaluate Amazon MQ for RabbitMQ. Explain why each decision follows from the communication requirements rather than assuming one service is always cheaper or faster.
Check Your Understanding
Solidify your learning with the interactive assessment directly below this lesson.
Concept Quiz & Questions
FIFO, deduplication and broker selection — knowledge check
Reason about fictional messaging workflows without AWS access.
Events for one order must be processed sequentially. How should they be grouped?
What if an identical FIFO send is retried outside the five-minute window?
With content-based SQS FIFO deduplication, what is hashed?
An existing application needs RabbitMQ protocol and routing behavior. Which option should be evaluated?
Why can a FIFO DLQ be risky for strict sequence requirements?