Need advice about which tool to choose?Ask the StackShare community!
Amazon S3 vs Amazon SQS vs Kue: What are the differences?
Introduction In this article, we will explore and compare the key differences between Amazon S3, Amazon SQS, and Kue. These are three popular services offered by Amazon Web Services (AWS) with different use cases and functionalities.
Response Storage: Amazon S3 is designed to store and retrieve large amounts of data as objects, providing scalable and durable storage infrastructure. On the other hand, Amazon SQS and Kue are messaging services that focus on the reliable and scalable delivery of data between distributed systems. While Amazon S3 can store and retrieve data, Amazon SQS and Kue allow for the efficient and reliable exchange of messages.
Message Queuing: Amazon SQS and Kue both offer message queuing capabilities, serving as intermediary systems responsible for the reliable and asynchronous transfer of messages between different components of a distributed system. Amazon SQS follows a standard message queue model, where messages are sent and received by applications, and it also supports both standard and FIFO (First-In-First-Out) queues. Kue, on the other hand, is specifically designed to be used with Node.js and focuses on processing jobs instead of general-purpose messaging.
Data Consistency and Availability: Amazon S3 provides strong data consistency, ensuring that once an object is stored, it can be immediately retrieved without conflicts or inconsistencies. It also offers high durability and availability, making it suitable for applications where data integrity and accessibility are key. In contrast, Amazon SQS and Kue focus on eventual consistency and availability, allowing for distributed systems to reliably exchange messages over time without ensuring immediate consistency.
Storage vs Processing: While Amazon S3 primarily focuses on storing and retrieving data, Amazon SQS and Kue focus more on message exchange and processing. With Amazon SQS, applications can decouple senders and receivers, enabling more scalable and fault-tolerant architectures. Kue, on the other hand, provides a powerful job processing system for Node.js applications, allowing for efficient scheduling, parallel processing, and task management.
Message Retention and Dead-Letter Queues: Amazon SQS provides configurable message retention, allowing developers to set a time duration during which messages are retained in the queue. Additionally, it supports dead-letter queues, which are used to capture messages that cannot be processed successfully after a certain number of retries. Kue, on the other hand, does not inherently provide these features and might require custom implementations to achieve similar functionalities.
Pricing Model: When it comes to pricing, Amazon S3 follows a model based on the amount of storage used and data transfer rates. It also offers different storage classes with varying costs to optimize for different access patterns. Amazon SQS and Kue, on the other hand, have separate pricing models based on the number of requests and message delivery attempts, making them more suitable for applications dealing with message exchange and processing.
In summary, Amazon S3 is a scalable storage service, while Amazon SQS and Kue are messaging services with queuing capabilities. Amazon S3 focuses on storing and retrieving data, while Amazon SQS and Kue prioritize reliable message exchange and processing. The key differences lie in their core functionalities, data consistency and availability, storage vs processing capabilities, message retention and dead-letter queues, and the pricing models they follow.
Hi, we are in a ZMQ set up in a push/pull pattern, and we currently start to have more traffic and cases that the service is unavailable or stuck. We want to: * Not loose messages in services outages * Safely restart service without losing messages (ZeroMQ seems to need to close the socket in the receiver before restart manually)
Do you have experience with this setup with ZeroMQ? Would you suggest RabbitMQ or Amazon SQS (we are in AWS setup) instead? Something else?
Thank you for your time
ZeroMQ is fast but you need to build build reliability yourself. There are a number of patterns described in the zeromq guide. I have used RabbitMQ before which gives lot of functionality out of the box, you can probably use the worker queues
example from the tutorial, it can also persists messages in the queue.
I haven't used Amazon SQS before. Another tool you could use is Kafka.
Both would do the trick, but there are some nuances. We work with both.
From the sound of it, your main focus is "not losing messages". In that case, I would go with RabbitMQ with a high availability policy (ha-mode=all) and a main/retry/error queue pattern.
Push messages to an exchange, which sends them to the main queue. If an error occurs, push the errored out message to the retry exchange, which forwards it to the retry queue. Give the retry queue a x-message-ttl and set the main exchange as a dead-letter-exchange. If your message has been retried several times, push it to the error exchange, where the message can remain until someone has time to look at it.
This is a very useful and resilient pattern that allows you to never lose messages. With the high availability policy, you make sure that if one of your rabbitmq nodes dies, another can take over and messages are already mirrored to it.
This is not really possible with SQS, because SQS is a lot more focused on throughput and scaling. Combined with SNS it can do interesting things like deduplication of messages and such. That said, one thing core to its design is that messages have a maximum retention time. The idea is that a message that has stayed in an SQS queue for a while serves no more purpose after a while, so it gets removed - so as to not block up any listener resources for a long time. You can also set up a DLQ here, but these similarly do not hold onto messages forever. Since you seem to depend on messages surviving at all cost, I would suggest that the scaling/throughput benefit of SQS does not outweigh the difference in approach to messages there.
Hello! I have a mobile app with nearly 100k MAU, and I want to add a cloud file storage service to my app.
My app will allow users to store their image, video, and audio files and retrieve them to their device when necessary.
I have already decided to use PHP & Laravel as my backend, and I use Contabo VPS. Now, I need an object storage service for my app, and my options are:
Amazon S3 : It sounds to me like the best option but the most expensive. Closest to my users (MENA Region) for other services, I will have to go to Europe. Not sure how important this is?
DigitalOcean Spaces : Seems like my best option for price/service, but I am still not sure
Wasabi: the best price (6 USD/MONTH/TB) and free bandwidth, but I am not sure if it fits my needs as I want to allow my users to preview audio and video files. They don't recommend their service for streaming videos.
Backblaze B2 Cloud Storage: Good price but not sure about them.
There is also the self-hosted s3 compatible option, but I am not sure about that.
Any thoughts will be helpful. Also, if you think I should post in a different sub, please tell me.
If pricing is the issue i'd suggest you use digital ocean, but if its not use amazon was digital oceans API is s3 compatible
Hello Mohammad, I am using : Cloudways >> AWS >> Bahrain for last 2 years. This is best I consider out of my 10 year research on Laravel hosting.
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
We offer our customer HIPAA compliant storage. After analyzing the market, we decided to go with Google Storage. The Nodejs API is ok, still not ES6 and can be very confusing to use. For each new customer, we created a different bucket so they can have individual data and not have to worry about data loss. After 1000+ customers we started seeing many problems with the creation of new buckets, with saving or retrieving a new file. Many false positive: the Promise returned ok, but in reality, it failed.
That's why we switched to S3 that just works.
Pros of Amazon S3
- Reliable590
- Scalable492
- Cheap456
- Simple & easy329
- Many sdks83
- Logical30
- Easy Setup13
- REST API11
- 1000+ POPs11
- Secure6
- Easy4
- Plug and play4
- Web UI for uploading files3
- Faster on response2
- Flexible2
- GDPR ready2
- Easy to use1
- Plug-gable1
- Easy integration with CloudFront1
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 Kue
- Simple2
Sign up to add or upvote prosMake informed product decisions
Cons of Amazon S3
- Permissions take some time to get right7
- Requires a credit card6
- Takes time/work to organize buckets & folders properly6
- Complex to set up3
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