Running apps on AWS · mid
SQS, SNS and EventBridge
SQS is a queue that workers pull from (a message is hidden for a visibility timeout while one worker handles it, and goes to a dead-letter queue after too many failed attempts), SNS pushes one message to many subscribers, and EventBridge routes events by rules and runs schedules.
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
- SQS standard queues: at-least-once delivery, best-effort ordering, nearly unlimited throughput. FIFO queues: ordered per message group, with deduplication.
- Visibility timeout: a received message is hidden; if the worker does not delete it before the timeout (crash, slow), it becomes visible again and is retried. Set the timeout longer than the processing time.
- Dead-letter queue: after maxReceiveCount failed receives the message moves to a DLQ for inspection and redrive.
- Consumers must be idempotent (duplicates happen). Lambda can consume SQS in batches; report partial batch failures so only failed messages retry.
- SNS: pub/sub fan-out (one 'OrderPlaced' message to several SQS queues, Lambda, email or SMS). SNS -> SQS fan-out gives each consumer its own queue and retries.
- EventBridge: an event bus with content-based routing rules, partner integrations, and EventBridge Scheduler for cron-like jobs.
The red pen
Common traps: mistake → fix
Mistake: SQS delivers each message exactly once
Fix: standard queues are at-least-once; design idempotent consumers.
Mistake: Receiving a message removes it
Fix: it is only hidden; you must delete it after processing.
Easy to hard
Questions interviewers ask, easy to hard
- SQS vs SNS vs EventBridge?
- What is a visibility timeout? What happens if the worker crashes?
- What is a dead-letter queue?
- How do you send one 'order placed' event to email, analytics and warehouse services?
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.