Cloud queues · mid
Fan-out with SNS, SQS and EventBridge
One SNS topic with one SQS queue per consumer gives each service its own buffer and retries. EventBridge adds content-based routing, archive and schedules, but has its own limits.
Explain it out loud
Explain it out loud to an AI interviewer that follows up, and see where your answer is thin.
Practise by voiceThe notes
What you must know
- Fan-out: one SNS topic, with one SQS queue per consumer subscribed. Each consumer gets its own buffer, retries, dead-letter queue and scaling, and can be down without losing events. A filter policy on a subscription sends only matching messages, for example orders above a numeric amount to a fraud queue.
- An external partner webhook: do not let their uptime reach you. Use a queue and your own worker with rate limit, timeouts, retries and a circuit breaker, or EventBridge API destinations.
- Order per customer: an SNS FIFO topic to SQS FIFO queues with the customer id as the group, or standard queues with consumers that check versions.
- Publish with an outbox, so an order never exists without its event. Make every consumer idempotent by event id and alarm on every dead-letter queue. A new consumer is a new queue and subscription, with no change to the publisher.
- EventBridge: event buses (default, custom, partner). Rules match JSON patterns and send to targets such as Lambda, SQS, Step Functions or another bus. EventBridge also offers archive and replay, schema discovery, Pipes (point-to-point with filtering) and Scheduler (one-time and recurring schedules with time zones).
- EventBridge delivery is at-least-once with no ordering. By default it retries for 24 hours and up to 185 times with back-off and jitter, then drops the event unless the target has a dead-letter queue.
- Limits: more delay per event than SNS or SQS, per-event price at very high volume, no buffering for slow consumers (put SQS in front), and no offset replay like Kafka.
The red pen
Common traps: mistake → fix
Mistake: One queue shared by six consumers gives each a copy
Fix: each message reaches only one consumer.
Mistake: Call the partner inside the order request
Fix: their outage becomes yours.
Mistake: EventBridge keeps events in order
Fix: it does not.
Mistake: EventBridge is for high-volume telemetry
Fix: cost and limits say no.
Easy to hard
Questions interviewers ask, easy to hard
- Design fan-out for six consumers on AWS.
- How do you send only large orders to the fraud service?
- What is EventBridge good and bad at?
- How do you handle a slow partner webhook?
Explain it out loud
Explain it out loud to an AI interviewer that follows up, and see where your answer is thin.
Practise by voiceYour first interview is free
Sign up and start with a 15-minute interview with the full report, and an English conversation. No card needed.