Need advice about which tool to choose?Ask the StackShare community!
Amazon SQS vs Scheduler API: What are the differences?
Introduction
Below are the key differences between Amazon Simple Queue Service (SQS) and Scheduler API.
Scalability and Availability: Amazon SQS is a fully managed message queuing service, designed to provide scalability and high availability. It automatically scales up or down based on the message throughput, ensuring that messages are reliably processed. On the other hand, the Scheduler API is used to schedule and run jobs on a defined schedule, but it does not provide automatic scaling or high availability like SQS.
Message Ordering: SQS guarantees the order in which messages are sent and received within a single message group, making it ideal for applications requiring strict message ordering. However, the Scheduler API does not provide any built-in guarantee for message ordering as it primarily focuses on scheduling and running jobs.
Message Retention: SQS allows you to store messages in a queue for up to 14 days, even if they are not processed immediately. This provides flexibility in handling messages that may take longer to process. In contrast, the Scheduler API does not provide any long-term message storage capability as it is primarily focused on scheduling and running jobs.
Job Scheduling Flexibility: The Scheduler API allows you to specify a cron expression or a rate expression to define the schedule for running jobs. This provides flexibility in defining complex schedules based on time or rate. SQS, on the other hand, does not have built-in job scheduling capabilities as it primarily focuses on message queuing.
Visibility Timeout: SQS provides a visibility timeout feature that allows you to control how long a message remains invisible to other consumers after it has been retrieved from the queue. This ensures that a message is not processed by multiple consumers simultaneously. The Scheduler API does not have a visibility timeout feature as it is primarily focused on job scheduling.
Delay Queue: SQS offers a delay queue feature that allows you to delay the delivery of messages for a specified amount of time. This can be useful in scenarios where you want to introduce a delay between the time a message is sent and when it becomes available for processing. The Scheduler API does not have a built-in delay queue functionality.
In summary, Amazon SQS is a scalable and highly available message queuing service that provides features like message ordering, message retention, and visibility timeout. On the other hand, the Scheduler API is primarily focused on scheduling and running jobs, offering flexibility in defining job schedules using cron or rate expressions.
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.
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
Pros of Amazon SQS
- Easy to use, reliable62
- Low cost40
- Simple28
- Doesn't need to maintain it14
- It is Serverless8
- Has a max message size (currently 256K)4
- Triggers Lambda3
- Easy to configure with Terraform3
- Delayed delivery upto 15 mins only3
- Delayed delivery upto 12 hours3
- JMS compliant1
- Support for retry and dead letter queue1
- D1
Pros of Scheduler API
Sign up to add or upvote prosMake informed product decisions
Cons of Amazon SQS
- Has a max message size (currently 256K)2
- Proprietary2
- Difficult to configure2
- Has a maximum 15 minutes of delayed messages only1