Ravi Sir's Cards › AWS
Why SNS then SQS?
This revision card explains Why SNS then SQS? It starts from the need that calling two Lambdas from the API ties failures together and blocks the client on both. It describes SNS fans out one message to many subscribers. SQS buffers each consumer so a slow email worker does not block inventory. The how-to section notes subscribe queue ARNs to the topic (SNS , then SQS). Grant SNS permission to SendMessage. Workers use event source mappings. An example on the card is pause the email worker; inventory still drains its queue. Restart email; backlog clears.
Read card text
What this card says
Why do we need it?
Calling two Lambdas from the API ties failures together and blocks the client on both.
What is it?
SNS fans out one message to many subscribers. SQS buffers each consumer so a slow email worker does not block inventory.
How to do it
Subscribe queue ARNs to the topic (SNS → SQS). Grant SNS permission to SendMessage. Workers use event source mappings.
Raw message delivery
Example
Pause the email worker; inventory still drains its queue. Restart email; backlog clears.