Member-only story

Use Case: SNS vs SQS

Nazreen Mohamad
2 min readDec 21, 2022

--

Amazon Simple Notification Service (SNS) and Amazon Simple Queue Service (SQS) are both cloud-based messaging services provided by Amazon Web Services (AWS). While both services can be used for communication between different applications and services, they differ in their use cases and capabilities.

SNS is a fully-managed pub/sub messaging service that enables you to send messages to large numbers of subscribers or other applications. It can be used to send notifications or messages to end users through various channels, including email, SMS, and mobile push notifications. SNS is typically used for one-to-many communication, where a single message is delivered to multiple recipients.

On the other hand, SQS is a fully-managed message queue service that enables you to decouple and scale microservices, distributed systems, and serverless applications. It allows you to send, store, and receive messages between software systems in a loosely coupled manner. SQS is typically used for asynchronous communication, where a message is delivered to a queue and processed by a consumer at a later time.

One key difference between SNS and SQS is the delivery guarantee. SNS is designed to deliver messages at least once to the subscribed endpoints, while SQS provides a “at least once” delivery guarantee for messages. This means that with SQS, it’s possible for a message to be delivered more than once, while with SNS, messages are delivered only once.

In summary, SNS is best suited for one-to-many communication and delivering messages to end users through various channels, while SQS is better for decoupling and scaling microservices and distributed systems. Both services can be used together to build sophisticated messaging systems, with SNS delivering messages to SQS queues for further processing.

--

--

Nazreen Mohamad
Nazreen Mohamad

Written by Nazreen Mohamad

Technical Instructor and Software Engineer.

No responses yet