CloudArcade

Guided architecture tour · 5–7 min

SQS architecture

Decouple a producer and worker, understand visibility, and design for retries and duplicate delivery.

This tour teaches architecture decisions. Its services are not provisioned in the emulator.

Play this architecture tour

1. Decouple the work

Order requests arrive faster than image-processing workers can finish. The web request should not wait for all processing.

Where should pending jobs wait?

In an SQS queue consumed by workers.

A queue separates accepting work from processing it. Workers can consume at their own rate.

The producer enqueues jobs while workers process them independently.

Producer → SendMessage → queue → ReceiveMessage → worker

2. Understand an in-flight message

A worker receives a message and starts processing it. The visibility timeout is 60 seconds.

Has receiving permanently removed the message?

No. It is temporarily hidden; delete it after successful processing.

Receiving and deleting are different operations. If processing fails or times out, the message can become visible again.

The worker deletes using the receipt handle only after it completes the work.

ReceiveMessage → process → DeleteMessage(ReceiptHandle)

3. Repair duplicate side effects

A standard queue delivers a job again after a retry. Charging the customer twice would be a serious bug.

What should the consumer do?

Use an idempotency key and record completed work.

Make repeated processing safe. A dead-letter queue can isolate repeated failures but does not replace idempotency.

Repeated delivery of the same job does not repeat its side effect.

jobId → check completion → perform once → record result

Practice, then check your understanding

In the interactive tour, make each decision before seeing the outcome. Wrong answers receive coaching, and replay gives you a fresh attempt without duplicating earned XP.

Read the official AWS documentation for service behavior and production details.

Continue with another AWS learning guide