Amazon Simple Queue Service

Amazon Simple Queue Service (Amazon SQS) is a distributed message queuing service introduced by Amazon.com in late 2004.[1] It supports programmatic sending of messages via web service applications as a way to communicate over the Internet. SQS is intended to provide a highly scalable hosted message queue that resolves issues arising from the common producer-consumer problem or connectivity between producer and consumer.

Amazon Simple Queue Service
Developer(s)Amazon.com
LicenseProprietary software
Websiteaws.amazon.com/sqs/

Amazon SQS can be described as commoditization of the messaging service. Well-known examples of messaging service technologies include IBM WebSphere MQ and Microsoft Message Queuing. Unlike these technologies, users do not need to maintain their own server. Amazon does it for them and sells the SQS service at a per-use rate.

API

Amazon provides SDKs in several programming languages including Java, Ruby, Python, .NET, PHP and JavaScript. A Java Message Service (JMS) 1.1 client for Amazon SQS was released in December 2014.

Authentication

Amazon SQS provides authentication procedures to allow for secure handling of data. Amazon uses its Amazon Web Services (AWS) identification to do this, requiring users to have an AWS enabled account with Amazon.com; this can be created at Amazon Web Services (AWS) - Cloud Computing Services. AWS assigns a pair of related identifiers, your AWS access keys, to an AWS enabled account to perform identification. The first identifier is a public 20-character Access Key. This key is included in an AWS service request to identify the user. If the user is not using SOAP (protocol) with WS-Security, a digital signature is calculated using the Secret Access Key. The Secret Access Key is a 40-character private identifier. AWS uses the Access Key ID provided in a service request to look up an account's Secret Access Key. Amazon.com then calculates a digital signature with the key. If they match then the user is considered authentic, if not then the authentication fails and the request is not processed.

Message delivery

Amazon SQS guarantees at-least-once delivery. Messages are stored on multiple servers for redundancy and to ensure availability. If a message is delivered while a server is not available, it may not be removed from that server's queue and may be resent. As of 2007, Amazon SQS does not guarantee that the recipient will receive the messages in the order they were sent by the sender. If message ordering is important, it is required that the application place sequencing information within the messages to allow for reordering after delivery.

Messages can be of any type, and the data contained within is not restricted. Message bodies were initially limited to 8KB in size but was later raised to 64KB on 2010-07-01[2] and then 256KB on 2013-06-18.[3] For larger messages, the user has a few options to get around this limitation. A large message can be split into multiple segments that are sent separately, or the message data can be stored using Amazon Simple Storage Service (Amazon S3) or Amazon DynamoDB with just a pointer to the data transmitted in the SQS message. Amazon has made an Extended Client Library available for this purpose An extension to the Amazon SQS client that enables sending and receiving messages up to 2GB via Amazon S3. : awslabs/amazon-sqs-java-extended-client-lib.

The service supports both unlimited queues and message traffic.

Message deletion

SQS does not automatically delete messages once they are sent. When a message is delivered, a receipt handle is generated for that delivery and sent to the recipient. These receipts are not sent with the message but in addition to it. SQS requires the recipient to provide the receipt in order to delete a message. This feature is new as of 2008 where only the message ID was required for message deletion. Because the system is distributed, a message may be sent more than once. In this case, the most recent receipt handle is needed to delete the message.

Once a message is delivered, it has a visibility timeout to prevent other components from consuming it. The "clock" for the visibility timeout starts once a message is sent, the default time being 30 seconds. If the queue is not told to delete the message during this time, the message becomes visible again and will be present.

Each queue also consists of a retention parameter defaulting to 4 days. Any message residing in the queue for longer will be purged automatically. The retention can be modified from 1 minute up to 14 days by the user. If the retention is changed while messages are already in the queue, any message that has been in the queue for longer than the new retention will be purged.

Notable usage

Dropbox, Netflix[4] and Nextdoor[5] are examples of companies that use SQS extensively. SQS is also widely used within Amazon.com.

Pricing

The first 1 million monthly requests are free. After that, the pricing is as follows for all regions:

Price per 1 Million Requests after Free Tier (Monthly)
Standard Queue $0.40 ($0.00000040 per request)
FIFO Queue $0.50 ($0.00000050 per request)

Data Transfer price

Pricing
Data Transfer IN
All data transfer in $0.000 per GB
Data Transfer OUT***
First 1 GB / month $0.000 per GB
Up to 10 TB / month $0.090 per GB
Next 40 TB / month $0.085 per GB
Next 100 TB / month $0.070 per GB
Next 350 TB / month $0.050 per GB
Next 524 TB / month Contact AWS
Next 4 PB / month Contact AWS
Greater than 5 PB / month Contact AWS
gollark: It can do simultaneous reads fine as far as I know.
gollark: SQLite is surprisingly good for at least small projects which don't need to run multiple writes at once.
gollark: Do you need to interact with a specific database?
gollark: Here's the SQLite one: https://docs.python.org/3/library/sqlite3.html
gollark: There's also... SQLAlchemy, the ORM, if I remember right.

See also

References

  1. "Jeff Barr's Blog". Jeff-barr.com. Retrieved 2015-08-13.
  2. "AWS Developer Forums: Amazon SQS introduces Free Tier and adds support for Larger Messages and Longer Retention". forums.aws.amazon.com. Archived from the original on August 29, 2011.
  3. "Amazon SQS and SNS Announce 256KB Large Payloads". Aws.amazon.com. 2013-06-18. Retrieved 2015-08-13.
  4. "Netflix TechBlog – Medium". Medium.
  5. Fang, Wenbin (August 13, 2014). "Nextdoor Taskworker: Simple, Efficient & Scalable". Nextdoor Engineering.
This article is issued from Wikipedia. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.