Post

Amazon broker services; a comparison guide

In this blog post we compare two AWS broker queue solutions!


πŸ“¬AWS SQS vs Amazon MQ : A Comparison GuideπŸ“­

A screenshot

INTRO

When designing a messaging system for your application on AWS, two of the most prominent services you may consider are AWS Simple Queue Service (SQS) and Amazon MQ. Both are managed messaging services offered by AWS, but they cater to different use cases and offer distinct features. This guide compares these services across several key areas, such as encryption, functionality, scalability, protocols, pricing, and more, to help you decide which one best fits your requirements.

What AWS SQS and Amazon MQ are?

  • AWS Simple Queue Service (SQS): is a fully managed message queue service for Apache ActiveMQ Classic and RabbitMQ which enables decoupled communication between distributed applications and services. It allows you to send, store, and receive messages between software components at any scale. SQS is highly scalable, cost-effective, and supports both standard queues and FIFO queues.

  • Amazon MQ: is a fully managed message broker service that supports industry-standard messaging protocols like AMQP, MQTT, OpenWire, and STOMP. It is designed for use cases requiring reliable, high-throughput messaging with support for protocols that are typically used by legacy and enterprise applications, such as Apache ActiveMQ and RabbitMQ. AWS MQ simplifies the management of these brokers and handles scaling, patching, and maintenance tasks.


I have compiled a list of key features offered by these tools to help guide our decision on when to choose one over the other.


πŸ” Encryption

  • AWS Simple Queue Service (SQS): supports server-side encryption (SSE) using AWS Key Management Service (KMS) for both standard and FIFO queues. This ensures that the messages are encrypted at rest and provides fine-grained access control.

  • Amazon MQ: AWS MQ also supports encryption, but it operates at a higher level by encrypting data both at rest and in transit. With support for SSL/TLS for secure communication and KMS for encryption at rest, it can ensure end-to-end security for your messaging data.

βš™ Functionalities

  • AWS Simple Queue Service (SQS): provides a simple, highly scalable, and reliable message queue with minimal setup. It is ideal for workloads that require a simple queueing mechanism with features like dead-letter queues (DLQs), visibility timeout, and message batching.

  • Amazon MQ: provides more advanced messaging functionality, supporting traditional message broker features like message persistence, transactions, topics for pub/sub patterns, message filtering, and message acknowledgment. It is suitable for systems requiring complex routing, persistence, and advanced messaging patterns.

🎚 Scalability

  • AWS Simple Queue Service (SQS): scales automatically to handle a virtually unlimited number of messages. It provides unlimited throughput in the case of standard queues, making it an ideal choice for high-volume, real-time systems.

  • Amazon MQ: while AWS MQ provides a scalable solution, it is designed more for environments where a certain level of message persistence and complex routing is needed. Scaling in AWS MQ typically requires provisioning broker instances, which may involve more manual configuration than SQS

🧩 Supported protocols

  • AWS Simple Queue Service (SQS): this cloud-native service supports a simple RESTful interface for interacting with queues via API calls. It does not support traditional messaging protocols directly (such as AMQP or MQTT).

  • Amazon MQ: supports multiple messaging protocols such as AMQP, MQTT, OpenWire, and STOMP. This makes it a better choice if you’re migrating legacy messaging systems or using protocols already in use in your on-premises systems.

πŸ’° Pricing

  • AWS Simple Queue Service (SQS): is based on the number of requests and the amount of data transferred. There is a free tier for the first 1 million requests per month, after which charges apply. SQS pricing is typically very cost-effective, especially for high-throughput use cases. Pricing start at 0.40$ from the first 1 Million to 100 Billions requests per month for standard queues and 0.50$ per FIFO queues.

  • Amazon MQ: is based on the instance size, data transfer, and the number of messages processed. You pay for the broker instance and storage, with separate costs for instance hours, storage usage, and data transfer. It’s generally more expensive than SQS, as it provides additional features such as message persistence and protocol support.

πŸ“• Characteristics

  • AWS Simple Queue Service (SQS): offers a lightweight, highly scalable queue service with automatic scaling, FIFO queues for ordered message delivery, and dead-letter queues for error handling. Making it a great fit for decoupling microservices or building serverless applications.

  • Amazon MQ: delivers more advance messaging features, such as transactions, message filtering, topic-based pub/sub messaging, message persistence, and high availability. It’s a better choice for complex applications that require sophisticated message routing, reliable delivery, and integration with legacy systems.

🚫 Limitations

  • AWS Simple Queue Service (SQS): messages can be retained from 1 minute and up to 15 days. While it supports high throughput, its API interface and lack of traditional message broker features (like transactions and complex routing) can make it less suitable for use cases requiring these capabilities.

  • Amazon MQ: includes a more complex setup compared to SQS, especially in scaling broker instances and it’s generally less cost-effective for small, high-throughput scenarios.


πŸ€” Still in doubt on which you should pick?

πŸ…Choose AWS Simple Queue Service(SQS) if:

  • A simple, scalable, cost-effective message queue with minimal operational overhead is needed.
  • Message decoupling and high throughput is needed when building a serverless architecture or microservices-based systems.
  • Traditional AMQP, MQTT or other legacy protocols are not needed.
  • Eventual consistency (using standard queues) or strict ordering requiremets (using FIFO queues) is required for your architecture.

πŸ…Choose Amazon MQ if:

  • Migrating legacy applications or enterprise systems that requires protocols such as AMQP, MQTT, OpenWire, or STOMP.
  • Advance features like message persistence, transactions, and topic-based pub/sub messaging are needed for the desired architecture.
  • Previously knowledge from application/developer teams where a more traditional message broker adds no learning curve and adds faster systems delivery.
  • Message persistance requirements for more than 14 days.

πŸ“ˆ Summary

AWS SQS and AWS MQ are both powerful, fully managed messaging services, but they cater to different use cases.

SQS is ideal for applications requiring a lightweight, highly scalable, and cost-effective messaging service with minimal setup.

It’s perfect for modern, serverless, or microservices-based applications. AWS MQ, on the other hand, is best suited for environments where you need to integrate with legacy systems or require advanced messaging features like message persistence, complex routing, and protocol support. The choice between the two depends largely on your specific needs: whether you need simplicity and scale (SQS) or advanced features and protocol compatibility (AWS MQ).

This post is licensed under CC BY 4.0 by the author.