Need advice about which tool to choose?Ask the StackShare community!

Amazon SQS

2.2K
2K
+ 1
171
MQTT

615
571
+ 1
7
Add tool

Amazon SQS vs MQTT: What are the differences?

Amazon SQS and MQTT are both messaging protocols used for communication between distributed systems. Let's explore the key differences between them.

  1. Scalability and Distribution: Amazon Simple Queue Service (SQS) is a fully managed message queuing service that allows you to decouple and scale microservices, distributed systems, and serverless applications. It provides unlimited throughput and can handle an unlimited number of messages. On the other hand, MQTT (Message Queuing Telemetry Transport) is a lightweight publish-subscribe messaging protocol designed for low-bandwidth, high-latency or unreliable networks. It is ideal for IoT applications and devices with limited resources.

  2. Messaging Patterns: Amazon SQS supports both standard and FIFO (First-In-First-Out) queues. Standard queues provide best-effort ordering of messages while FIFO queues guarantee exactly-once processing of messages. MQTT, on the other hand, follows the publish-subscribe messaging pattern. Publishers send messages to a topic, and subscribers can receive those messages by subscribing to the topic.

  3. Batching and Message Size: In Amazon SQS, messages can be sent and received in batches, allowing you to improve throughput and reduce costs. The maximum size of a single message in SQS is 256KB. In MQTT, messages are sent individually without any batching options. The maximum size of a message in MQTT can vary depending on the implementation.

  4. Security and Authentication: Amazon SQS integrates with AWS Identity and Access Management (IAM), allowing you to control access to your queues using IAM policies. It also supports server-side encryption for message data at rest. MQTT provides its own security mechanisms such as SSL/TLS encryption for secure communication. It also supports authentication and access control through username and password or X.509 certificates.

  5. Persistence and Retention: Amazon SQS guarantees the durability of messages by storing them redundantly across multiple servers. Messages are retained until they are explicitly deleted or their retention period expires. MQTT does not provide built-in message persistence. Once a message is delivered to subscribers, it is not stored on the server and is not available for retrieval later.

  6. Delivery Guarantees: Amazon SQS provides at-least-once message delivery. This means that a message is delivered to a consumer at least once, but duplicate messages may be delivered. MQTT offers different levels of Quality of Service (QoS), including at-most-once (0), at-least-once (1), and exactly-once (2) delivery. This allows you to choose the level of delivery guarantee based on your application's requirements.

In summary, SQS is a fully-managed message queuing service that scales well and supports various messaging patterns, while MQTT is a lightweight protocol designed for IoT applications with limited resources and operates on a publish-subscribe model.

Advice on Amazon SQS and MQTT
MITHIRIDI PRASANTH
Software Engineer at LightMetrics · | 4 upvotes · 289K views
Needs advice
on
Amazon MQAmazon MQ
and
Amazon SQSAmazon SQS
in

I want to schedule a message. Amazon SQS provides a delay of 15 minutes, but I want it in some hours.

Example: Let's say a Message1 is consumed by a consumer A but somehow it failed inside the consumer. I would want to put it in a queue and retry after 4hrs. Can I do this in Amazon MQ? I have seen in some Amazon MQ videos saying scheduling messages can be done. But, I'm not sure how.

See more
Replies (1)
Andres Paredes
Lead Senior Software Engineer at InTouch Technology · | 1 upvotes · 220.1K views
Recommends
on
Amazon SQSAmazon SQS

Mithiridi, I believe you are talking about two different things. 1. If you need to process messages with delays of more 15m or at specific times, it's not a good idea to use queues, independently of tool SQM, Rabbit or Amazon MQ. you should considerer another approach using a scheduled job. 2. For dead queues and policy retries RabbitMQ, for example, doesn't support your use case. https://medium.com/@kiennguyen88/rabbitmq-delay-retry-schedule-with-dead-letter-exchange-31fb25a440fc I'm not sure if that is possible SNS/SQS support, they have a maximum delay for delivery (maxDelayTarget) in seconds but it's not clear the number. You can check this out: https://docs.aws.amazon.com/sns/latest/dg/sns-message-delivery-retries.html

See more
Manage your open source components, licenses, and vulnerabilities
Learn More
Pros of Amazon SQS
Pros of MQTT
  • 62
    Easy to use, reliable
  • 40
    Low cost
  • 28
    Simple
  • 14
    Doesn't need to maintain it
  • 8
    It is Serverless
  • 4
    Has a max message size (currently 256K)
  • 3
    Triggers Lambda
  • 3
    Easy to configure with Terraform
  • 3
    Delayed delivery upto 15 mins only
  • 3
    Delayed delivery upto 12 hours
  • 1
    JMS compliant
  • 1
    Support for retry and dead letter queue
  • 1
    D
  • 3
    Varying levels of Quality of Service to fit a range of
  • 2
    Lightweight with a relatively small data footprint
  • 2
    Very easy to configure and use with open source tools

Sign up to add or upvote prosMake informed product decisions

Cons of Amazon SQS
Cons of MQTT
  • 2
    Has a max message size (currently 256K)
  • 2
    Proprietary
  • 2
    Difficult to configure
  • 1
    Has a maximum 15 minutes of delayed messages only
  • 1
    Easy to configure in an unsecure manner

Sign up to add or upvote consMake informed product decisions

What is Amazon SQS?

Transmit any volume of data, at any level of throughput, without losing messages or requiring other services to be always available. With SQS, you can offload the administrative burden of operating and scaling a highly available messaging cluster, while paying a low price for only what you use.

What is MQTT?

It was designed as an extremely lightweight publish/subscribe messaging transport. It is useful for connections with remote locations where a small code footprint is required and/or network bandwidth is at a premium.

Need advice about which tool to choose?Ask the StackShare community!

What companies use Amazon SQS?
What companies use MQTT?
Manage your open source components, licenses, and vulnerabilities
Learn More

Sign up to get full access to all the companiesMake informed product decisions

What tools integrate with Amazon SQS?
What tools integrate with MQTT?

Sign up to get full access to all the tool integrationsMake informed product decisions

Blog Posts

GitHubPythonNode.js+47
55
72789
GitGitHubSlack+30
27
18692
GitHubDockerAmazon EC2+23
12
6613
GitHubPythonSlack+25
7
3223
What are some alternatives to Amazon SQS and MQTT?
Amazon MQ
Amazon MQ is a managed message broker service for Apache ActiveMQ that makes it easy to set up and operate message brokers in the cloud.
Kafka
Kafka is a distributed, partitioned, replicated commit log service. It provides the functionality of a messaging system, but with a unique design.
Redis
Redis is an open source (BSD licensed), in-memory data structure store, used as a database, cache, and message broker. Redis provides data structures such as strings, hashes, lists, sets, sorted sets with range queries, bitmaps, hyperloglogs, geospatial indexes, and streams.
ActiveMQ
Apache ActiveMQ is fast, supports many Cross Language Clients and Protocols, comes with easy to use Enterprise Integration Patterns and many advanced features while fully supporting JMS 1.1 and J2EE 1.4. Apache ActiveMQ is released under the Apache 2.0 License.
Amazon SNS
Amazon Simple Notification Service makes it simple and cost-effective to push to mobile devices such as iPhone, iPad, Android, Kindle Fire, and internet connected smart devices, as well as pushing to other distributed services. Besides pushing cloud notifications directly to mobile devices, SNS can also deliver notifications by SMS text message or email, to Simple Queue Service (SQS) queues, or to any HTTP endpoint.
See all alternatives