Differences between Amazon SQS, Amazon MQ, and Amazon SNS
Amazon SQS, Amazon SNS
Amazon SQS offers hosted queues that integrate and
decouple distributed software systems and components. Amazon SQS provides a generic web services
API that you can access using any programming language supported by Amazon SDK.
Messages in the queue are typically processed by a single subscriber.
Amazon SQS and Amazon SNS are often used together to create a
fanout messaging application
Amazon SNS is a publish-subscribe service that provides message delivery from publishers (also known as producers) to multiple subscriber endpoints(also known as consumers). Publishers communicate asynchronously with subscribers by sending messages to a topic, which is a logical access point and communication channel. Subscribers can subscribe to an Amazon SNS topic and receive published messages using a supported endpoint type, such as Amazon Data Firehose, Amazon SQS, Lambda, HTTP, email, mobile push notifications, and mobile text messages (SMS). Amazon SNS acts as a message router and delivers messages to subscribers in real time. If a subscriber is not available at the time of message publication, the message is not stored for later retrieval.
Amazon MQis a managed message broker
service that provides compatibility with industry standard messaging protocols such as
Advanced Message Queueing Protocol (AMQP) and Message Queuing Telemetry Transport (MQTT).
Amazon MQ currently supports Apache ActiveMQ
The following chart provides an overview of each services' resource types:
Resource type | Amazon SNS | Amazon SQS | Amazon MQ |
---|---|---|---|
Synchronous | No | No | Yes |
Asynchronous | Yes | Yes | Yes |
Queues | No | Yes | Yes |
Publisher-subscriber messaging | Yes | No | Yes |
Message brokers | No | No | Yes |
Both Amazon SQS and Amazon SNS are recommended for new applications that can benefit from nearly unlimited scalability and simple APIs. We recommend Amazon MQ for migrating applications from existing message brokers that rely on compatibility with APIs such as JMS or protocols such as Advanced Message Queuing Protocol (AMQP), MQTT, OpenWire, and Simple Text Oriented Message Protocol (STOMP).