Commentary

Comparing Amazon MQ and Amazon SQS: How to Choose Between Them for New Development and Migrating to Existing MQ Systems

Eye-catching image
table of contents

Both Amazon MQ and Amazon SQS are messaging services on AWS. However, the criteria for choosing between them differ.

Amazon MQ is suitable if you want to migrate existing message brokers such as ActiveMQ or RabbitMQ to AWS. On the other hand, Amazon SQS is a strong option when designing new asynchronous processing and queuing on AWS.

When selecting a solution, the number of features isn't the most important factor. You need to consider whether you need to retain existing protocols and application specifications, or if they can be rebuilt as an AWS native configuration. This premise will determine which service you should choose.

This article outlines the differences between Amazon MQ and Amazon SQS based on their intended use, protocol compatibility, operational burden, scalability, and migration considerations, and explains how to choose the service that best suits your company's requirements.

Differences between Amazon MQ and Amazon SQS

Both Amazon MQ and Amazon SQS are AWS services for passing messages between systems. However, the selection criteria differ.

Amazon MQ is a managed service that allows you to use existing message brokers such as ActiveMQ and RabbitMQ on AWS. Amazon SQS is a fully managed service that configures asynchronous processing and queuing on AWS.

The main difference lies in whether you retain your existing messaging specifications or redesign them natively for AWS. If you want to leverage existing protocols and application implementations, Amazon MQ is a good choice; if you need to design new asynchronous processing, Amazon SQS is the better option.

Amazon MQ is a service that allows you to use existing message brokers on AWS.

Amazon MQ is a managed message broker that allows you to use Apache ActiveMQ and RabbitMQ on AWS.

If your existing system uses ActiveMQ or RabbitMQ, the message sending and receiving method, connection destination, protocol, and application-side implementation are already determined. Changing this configuration for Amazon SQS expands the scope of application modifications and testing.

Amazon MQ is well-suited for migrating to AWS while leveraging existing messaging configurations. In particular, applications that rely on standard protocols such as JMS and AMQP can minimize the scope of changes during migration.

However, Amazon MQ is not a superior version of Amazon SQS. It is a service that prioritizes compatibility with existing brokers and is not always the priority service for new development.

Amazon SQS is an AWS native queuing service.

Amazon SQS is a fully managed message queueing service provided by AWS. It is used to place queues between applications to asynchronously process data and loosely couple systems.

Processes that do not require immediate completion, such as sending emails after an order is placed, image conversion, log processing, and background jobs, can be placed in a queue and executed in subsequent processes. Even if the processing volume temporarily increases, the queue acts as a buffer, preventing the application itself from becoming overloaded.

Amazon SQS uses queues as a service, without requiring the construction or management of a broker. It does not aim for compatibility with existing protocols like ActiveMQ or RabbitMQ, but sends and receives messages using the SQS API.

When designing new asynchronous processing on AWS, Amazon SQS is the top choice. It integrates with AWS Lambda, Amazon ECS, Amazon EC2, and more, allowing you to implement asynchronous processing with a simple configuration.

The biggest difference is whether to "keep the existing specifications" or "rebuild it for AWS."

The difference between Amazon MQ and Amazon SQS lies not in the number of features, but in the underlying design assumptions.

If your existing system uses ActiveMQ or RabbitMQ and you cannot significantly change protocols or existing implementations such as JMS, AMQP, or MQTT, Amazon MQ is a viable option. By leveraging your existing messaging specifications, you can minimize the scope of modifications required during migration.

On the other hand, if new development or AWS-native redesign is possible, consider Amazon SQS. Because it allows you to use queues without a broker configuration, it simplifies the configuration of asynchronous processing and inter-system integration.

When comparing Amazon MQ and SQS, the first thing to consider is not "which is more feature-rich," but whether it's necessary to retain existing specifications. Once you've clarified this premise, you can then judge the differences in use, protocol compatibility, operational burden, scalability, and cost.

Five perspectives for comparing Amazon MQ and Amazon SQS

When selecting between Amazon MQ and Amazon SQS, we will examine the following factors separately: intended use, protocol compatibility, scope of application modifications, operational burden, scalability, and cost structure.

When migrating from an existing MQ, we consider not only whether the same functionality can be achieved, but also the design changes and migration risks involved in replacing it with Amazon SQS.

Comparison item

Amazon MQ

Amazon SQS

Main uses

Migrating and operating existing ActiveMQ and RabbitMQ systems on AWS.

Building new asynchronous processing and queuing on AWS.

Nature of the service

Managed Message Broker

Fully managed message queue

Suitable development

Migration of existing systems, configurations requiring compatibility with existing MQ systems.

New development, serverless, microservices integration

Protocol compatibility

Supports JMS, AMQP, MQTT, STOMP, etc.

Available via the SQS API. Compatibility with existing MQ protocols is not assumed.

App improvements

Can leverage existing implementations

Implementation and design must be based on Amazon SQS.

operational load

Be mindful of broker configuration, number of connections, capacity, and availability.

You can use the queue without broker management.

Scalability

Design according to the broker configuration.

It is easy to handle configurations that deal with large volumes of messages.

Cost considerations

Costs are incurred depending on the broker's operating hours and configuration.

Consider usage-based factors such as the number of requests and the amount of data transferred.

Selection criteria

If you want to retain the existing MQ specifications

When designing a new AWS native system

Differences in use

Amazon MQ is used when you want to migrate an existing message broker to AWS. This is the case when you are using ActiveMQ or RabbitMQ on-premises or in a different environment and want to move to AWS without significantly changing the existing system.

On the other hand, Amazon SQS is suitable for creating new asynchronous processes on AWS. It is ideal for configurations where processes that do not need to be completed immediately, such as post-order processing, image conversion, notification processing, logging, and background jobs, are queued and executed sequentially by subsequent processes.

Protocol compatibility differences

Amazon MQ is a managed service based on ActiveMQ and RabbitMQ. Therefore, it is compatible with applications that use existing messaging protocols such as JMS, AMQP, MQTT, and STOMP.

If your existing system is designed based on these protocols, replacing them with Amazon SQS may require changes to your application's implementation. This will involve reviewing message sending and receiving methods, connection methods, error handling, and retry design, so it won't be a simple replacement.

Amazon SQS is a service that sends and receives messages via the SQS API. It is not a service intended for compatibility with the existing MQ protocol, so caution is needed in migration projects that require protocol compatibility.

Differences in operational load

Amazon MQ is a managed service, but since it uses a broker, you need to be aware of the broker's instance type, number of connections, availability, storage, and how it behaves in the event of a failure.

While it reduces the load compared to running ActiveMQ or RabbitMQ in-house, it requires a deeper understanding of the broker configuration and more careful design and operation compared to Amazon SQS.

Amazon SQS allows you to use queues without having to worry about a broker. Creating queues, sending messages, receiving messages, deleting messages, retrying, dead-letter queues, and more are all handled as AWS managed functions, simplifying operations.

If you want to minimize the operational burden as much as possible, Amazon SQS is a more user-friendly option.

Differences in scalability

Amazon MQ scalability depends on the broker configuration. Depending on your workload, you need to design your instance type, broker configuration, number of connections, message volume, and other factors accordingly.

While it's easy to design using the same approach as existing MQ systems, careful capacity planning is crucial to handle rapid load fluctuations and large-scale distributed processing.

Amazon SQS is a distributed queue service that handles large volumes of messages. Even when processing volume increases, messages can be passed to subsequent processing via the queue, making it well-suited to absorbing temporary load spikes.

In particular, when combined with processing infrastructure such as AWS Lambda or ECS, using Amazon SQS makes it easier to scale the processing side in stages.

Differences in cost concepts

Amazon MQ is a service that runs a broker. Therefore, costs are calculated based on the broker instance type, uptime, storage, data transfer, etc. Even with a small message volume, a certain cost is incurred while the broker is running.

Amazon SQS is a service where costs are calculated based on usage, such as the number of requests and the amount of data transferred. It's easy to start small, and the cost increases as usage increases, making it a convenient pricing structure for new development or workloads with high variability.

However, it's not simply a matter of saying "Amazon SQS is cheaper." When rewriting an existing application for Amazon SQS, you need to consider the costs involved in development, testing, and migration as well.

When comparing costs, you should consider not only AWS usage fees, but also application modification costs, migration risks, and operational effort.

When should you choose Amazon MQ?

Amazon MQ is a viable option when migrating existing messaging configurations to AWS. In particular, for systems already using ActiveMQ or RabbitMQ, using Amazon MQ minimizes the impact of the migration compared to replacing them with Amazon SQS.

When making your selection, don't just decide based on whether or not it uses queues. Check which protocols and broker functions your existing application depends on. The stronger the dependency on existing specifications, the more you should consider Amazon MQ.

We want to migrate our existing ActiveMQ and RabbitMQ systems to AWS.

If your existing system uses ActiveMQ or RabbitMQ, Amazon MQ is a good option. You can run it as a managed service on AWS without significantly changing your current message broker configuration.

When replacing an on-premises ActiveMQ environment with Amazon SQS, you will need to review the message sending and receiving implementation and connection methods. Queue names, connection destinations, authentication methods, retry processes, and error handling should all be redesigned.

With Amazon MQ, you can migrate to AWS in a way that closely resembles your existing broker configuration. While verification during the migration is necessary, a major advantage is that it doesn't necessarily require a significant redesign of your existing applications.

If you are using an existing MQ, instead of assuming a replacement with Amazon SQS from the start, compare the scope of modifications required for migrating with Amazon MQ versus redesigning for Amazon SQS.

I want to continue using existing protocols such as JMS and AMQP.

Amazon MQ is suitable for applications using standard messaging protocols such as JMS, AMQP, MQTT, and STOMP. If your existing applications rely on these protocols, you can leverage your existing design by using Amazon MQ.

Amazon SQS is an AWS native queue service. It is not a service intended for compatibility with the existing MQ protocol. Therefore, migrating applications that use JMS or AMQP to Amazon SQS requires more than just changing the connection destination.

If your system relies on specific protocols, routing methods, connection management, acknowledgments, or transaction processing, you may not be able to directly replicate the same design in Amazon SQS.

If you need to continue using existing protocols, I would prioritize considering Amazon MQ. However, if you have no dependencies on existing protocols and can restructure your processing for AWS, Amazon SQS is simpler.

We want to minimize application modifications.

Amazon MQ is also a good option if you want to minimize application modifications. In applications using existing message brokers, the implementation of sending and receiving messages is often tightly tied to the business logic.

Replacing such a system with Amazon SQS involves more than just infrastructure migration; it requires changes to the application design. This includes adapting to the SQS API, modifying message processing methods, handling retries and duplicate processing, and reviewing monitoring parameters.

With Amazon MQ, you can operate on AWS while leveraging your existing messaging methods. It's a practical option if you want to migrate to AWS quickly or minimize the impact on your existing systems.

However, just because it minimizes modifications doesn't mean Amazon MQ is always the best option. If you plan to migrate to an AWS-native configuration in the future, you need to decide whether to use Amazon MQ as a temporary migration destination or as your long-term messaging infrastructure.

When should you choose Amazon SQS?

Amazon SQS is a viable option when designing new asynchronous processing or queuing solutions on AWS. It offers a simpler configuration than Amazon MQ if compatibility with existing ActiveMQ or RabbitMQ systems is not required.

Amazon SQS is particularly well-suited for serverless configurations and inter-microservice integration. By avoiding bottling up processing within the application itself and instead passing it to subsequent processes via a queue, the impact of load concentration and processing delays can be minimized.

Building a new asynchronous process on AWS

If you're building a new asynchronous processing system on AWS, Amazon SQS is the top choice.

It's not necessary to process everything synchronously, including inventory updates after order acceptance, email sending, image conversion, log processing, batch processing, and external system integration. By separating processes that respond immediately to user input from those that are executed later, you can maintain the responsiveness of the entire application.

Amazon SQS is well-suited for configurations that queue subsequent processing and retrieve it asynchronously. Even if the processing volume temporarily increases, the queue acts as a buffer, distributing the load on the application itself.

For new development that isn't tied to existing message broker specifications, there are limited reasons to use Amazon MQ. For simple asynchronous processing, consider Amazon SQS.

I want to easily integrate with AWS services such as AWS Lambda and ECS.

Amazon SQS is used in conjunction with other AWS services such as AWS Lambda, ECS, and EC2.

For example, you can create a configuration where a message is sent to Amazon SQS, and that message triggers processing in AWS Lambda. If you process it in a container, a worker on ECS will retrieve the message from Amazon SQS and process it.

Using Amazon SQS eliminates the need for direct connections between applications. The sender places messages in a queue, and the receiver processes them at its own convenience.

In a microservices architecture, it's crucial to avoid tight coupling between services. Using Amazon SQS helps mitigate the risk of processing delays or temporary failures in one service directly impacting the other.

When designing a system primarily using AWS services, Amazon SQS is an easy service to integrate.

I want to avoid broker operations as much as possible.

If you don't want to use a broker, Amazon SQS is another option.

Amazon MQ is a managed service, but since it uses a broker, you need to design the instance type, number of connections, storage, availability, failover, version control, etc. It is effective for migrating existing MQ systems, but you should carefully consider whether you need a broker configuration for new development.

Amazon SQS is a system that uses queues as a service, rather than managing brokers. Users can focus on designing message sending, receiving, deletion, retries, dead-letter queues, and more.

Amazon SQS is suitable when you have limited operational resources or want to focus on application development rather than infrastructure management.

However, using Amazon SQS doesn't eliminate the need for design. Visibility timeouts, duplicate handling, retries, dead-letter queues, and FIFO queues are all aspects that need to be considered during the design process. Nevertheless, the operational burden is lower compared to configurations that require managing the broker itself.

Cases where Amazon SQS can replace Amazon MQ and cases where it cannot.

When migrating an existing message broker to AWS, there are times when you need to consider whether Amazon SQS can replace Amazon MQ.

However, Amazon SQS is not a simple replacement for Amazon MQ. Whether it can be replaced depends on which features of the message broker your existing system depends on.

Simple asynchronous processing can easily be replaced with Amazon SQS.

If the message broker's purpose is simple asynchronous processing, Amazon SQS can sometimes be used as an alternative.

For example, an application can queue processing requests, and workers can retrieve and process them in order. Sending emails after an order is placed, image conversion, log processing, batch processing, and integration with external systems are all applications that are well-suited to Amazon SQS.

In cases like this, it's more important to isolate processing via queues than to rely on the advanced features of the existing MQ. If you can rebuild your processing infrastructure on AWS, you can simplify the configuration with Amazon SQS.

However, when replacing with Amazon SQS, you will need to design for issues such as duplicate message reception, visibility timeouts, retries, and dead-letter queues. Do not assume the same behavior as the existing MQ; design the processing to conform to the specifications of Amazon SQS.

If it relies on existing MQ protocols and functions, it is difficult to replace.

If your existing system relies on ActiveMQ or RabbitMQ protocols or features, replacing them with Amazon SQS will be difficult.

Applications that rely on protocols such as JMS or AMQP will need to modify their message sending and receiving implementations when migrating to Amazon SQS. Connection methods, authentication, acknowledgments, exception handling, transactions, and routing will also need to be reviewed.

Furthermore, caution is needed if you are relying on the fine-grained behavior of existing MQ exchanges, topics, complex routing, priority control, persistence, and acknowledgments. While Amazon SQS also has FIFO queues and dead-letter queues, it is not a service that directly replicates the functionality of ActiveMQ or RabbitMQ.

In this case, replacing it with Amazon SQS would be closer to a complete redesign of the messaging architecture than a simple "migration." If you need to retain existing specifications, choosing Amazon MQ is a more practical option.

When migrating, look at the "scope of modifications" rather than the "functions".

When comparing Amazon MQ and Amazon SQS, don't judge solely on the list of features. What you should look at is which features your current system depends on and how much modification will be required if you migrate to Amazon SQS.

If the configuration is simply "putting messages into a queue and having subsequent processing units retrieve them," then Amazon SQS can handle it. On the other hand, if you are using JMS, AMQP, broker-specific routing, acknowledgments, or transaction processing, then significant design changes will be required.

If you want to retain the existing specifications, use Amazon MQ; if you can redesign it for AWS, use Amazon SQS. By deciding on this premise first, you can determine whether an alternative is feasible.

Which should I choose: Amazon MQ or Amazon SQS?

When choosing between Amazon MQ and Amazon SQS, the first thing to check is whether you need to retain your existing messaging specifications.

If you want to migrate existing ActiveMQ or RabbitMQ to AWS and minimize application modifications, Amazon MQ is a good choice. On the other hand, if you are designing new asynchronous processing on AWS, Amazon SQS should be your first choice.

While both services are often compared for similar purposes, the criteria for selecting them are not the same. Amazon MQ is a service that prioritizes compatibility with existing brokers, while Amazon SQS is a service that simplifies queuing on AWS.

If you're migrating from an existing MQ, consider Amazon MQ.

If your existing system uses ActiveMQ or RabbitMQ, you should consider Amazon MQ. Replacing it with Amazon SQS will involve significant modifications, especially if your system relies on protocols like JMS or AMQP, broker-specific routing, acknowledgments, or connection methods.

In cases like this, migrating to Amazon SQS is not just a service change, but a complete redesign of the application. Because it involves changes to message sending and receiving implementation, retry processing, error handling, monitoring items, and even the scope of testing, migration costs will increase significantly.

With Amazon MQ, you can migrate to AWS using a similar approach to your existing message broker. It's suitable for situations where you want to leverage the specifications of your existing applications while entrusting some of your infrastructure operations to AWS.

However, even when choosing Amazon MQ, it's not always possible to simply transfer your existing configuration. Availability, connection count, message volume, failure handling behavior, and monitoring design will need to be re-evaluated on AWS.

For new development projects, Amazon SQS should be the first choice.

If you're building a new asynchronous processing system on AWS, Amazon SQS is the first choice. If you're not tied to an existing message broker specification, there are limited reasons to choose Amazon MQ.

Amazon SQS is well-suited for configurations that use queues to isolate processing. For new development, simplicity of configuration, low operational burden, and integration with AWS services are prioritized over compatibility with existing protocols. In such cases, Amazon SQS is a practical choice.

If you're unsure, consider whether it's necessary to retain the existing specifications.

If you're deciding between Amazon MQ and Amazon SQS, don't base your decision on the number of features or the impression the service name gives. What you should look at is whether you need to retain your existing specifications.

If you cannot significantly change your existing messaging protocol, application implementation, broker functionality, and operational procedures, then consider Amazon MQ. If your goal is to "move to AWS without significantly changing the current system," then Amazon MQ is a realistic option.

On the other hand, if there is little dependence on existing specifications and it is possible to design asynchronous processing from scratch on AWS, then Amazon SQS is the better choice. Because it does not require a broker configuration and processing can be separated using queues, it is an easier configuration to manage from an operational standpoint.

The criteria for making a decision can be summarized as follows:

Points to consider

Cases where Amazon MQ is suitable

Cases where Amazon SQS is suitable

Development prerequisites

Migration of existing systems

New development and redesign

Existing protocols

I want to continue using JMS, AMQP, etc.

Compatibility with existing protocols is not required.

App improvements

I want to keep it to a minimum.

Can be implemented with Amazon SQS as the basis.

Operation policy

I want to maintain the broker configuration.

I don't want to use a brokerage.

AWS integration

I want to run my existing MQ on AWS.

AWS I want to integrate with Lambda, ECS, etc.

For migrating existing MQ systems, we primarily use Amazon MQ, while for new development, we use Amazon SQS. Furthermore, by determining how much of the existing specifications need to be retained and how much can be rebuilt for AWS, we can reduce the likelihood of making the wrong selection decision.

Summary: Choose between Amazon MQ and Amazon SQS based on prerequisites, not intended use.

Both Amazon MQ and Amazon SQS are messaging services on AWS. However, the criteria for choosing between them differ.

Amazon MQ is suitable for migrating existing ActiveMQ, RabbitMQ, etc., to AWS while retaining existing protocols and application specifications. For systems that rely on JMS, AMQP, etc., using Amazon MQ will minimize the scope of modifications compared to replacing them with Amazon SQS.

On the other hand, Amazon SQS is suitable for building new asynchronous processing and queuing on AWS. It is easy to combine with AWS Lambda and ECS, and allows for loose coupling of processing between applications without the need for broker operations.

When comparing the two, the key consideration isn't "which one has more features," but rather whether you need to retain existing specifications or if you can redesign it natively to AWS. If you're migrating an existing MQ, Amazon MQ is the better choice; if you're developing a new system or redesigning it natively to AWS, Amazon SQS is the better option. This helps clarify your selection criteria.

Kazuki Kato
The person who wrote the article
Kazuki Kato

Server Works Co., Ltd.
Marketing Department, Marketing Section 1
After working in sales for independent ISPs and system integrators, where I was involved in optimizing customers' systems and networks, I joined Serverworks. Since joining, I have worked on development standardization projects for power carriers and proposed and implemented station announcement systems for railway operators. Currently, I am in charge of event marketing and inside sales.
My hobby is washing cars.
AWS Certified Database – Specialty (DBS)

If you have any questions about AWS,
issues like these?

If you have any questions or concerns about using AWS, getting quotes, configuring your system, or operating it, please feel free to contact us.
We help facilitate smooth decision-making by establishing a shared understanding with the local team and clarifying the prerequisites.

We offer end-to-end solutions to address all your AWS-related challenges.

Image of a city nightscape intersecting with blue lines of light symbolizing a digital network