AMAZON - SQS SERVICE..!!
ABOUT AMAZON SQS
AWS- Amazon web Services is one of the leading cloud providers in the world. AWS has various services which helps in the development of industrial use cases one of the Service is Amazon SQS which works on a massive scale, processing billions of messages per day. We can scale the amount of traffic we send to Amazon SQS up or down without any configuration. Amazon SQS also provides extremely high message durability, giving us and the stakeholders added confidence.
SQS - Amazon Simple Queue Service offers a secure, durable, and available hosted queue that lets you integrate and distributed software systems and components. Using SQS, We can send, store, and receive messages between software components at any volume, without losing messages or requiring other services to be available. Amazon SQS provides several advantages over building your own software for managing message queues or using commercial or open-source message queuing systems that require significant up-front time for development and configuration.
Here is a quick view on which domains in real world AWS SQS Service is Contributing..!!!
Now Understanding the working and benefits about why these Organizations are using this Service..!!!
About Message Queue
In computer science, a queue is a collection of entities that are maintained in a sequence and can be modified by the addition of entities at one end of the sequence and the removal of entities from the other end of the sequence. This follows FIFO- First in First Out.
There is a producer who want to produce messages so propagating this use of messages we use the Service of AWS called the SQS. The producer are the one who sends the message to the queue and Consumer are the one’s who receive the message by Simple Message Queue.
Let us consider an Example:
We have customers and the customer place the orders at the food counter but it orders in sequential manner. The order is placed one person at a time hypothetically means the chef is cooking one order at a time. So the customers are moving in a single queue. so here we have multiple producers and a single consumer This is sequential way that is following FIFO approach.
So through the figure it is pretty clear that the cars are the customers which are demanding for food orders at the counter and through the counter the requests are send in a sequential order to the chef and each request is completed one by one in a sequential manner. The processing here is sequential messaging processing.
Another example Where we have multiple consumers and multiple producer is there. Here messages are processed based on type of messages they receive. These messages will be processed asynchronously not in sequential way.
Amazon offers two types of Message Queue
- Standard Queues
2. SQS FIFO Queues
Amazon SQS offers standard as the default queue type. Standard queues support a nearly unlimited number of API calls per second, per API action. (send message, delete message, receive message). Standard queues support at-least-once message delivery.
FIFO (First-In-First-Out) queues are designed to enhance messaging between applications when the order of operations and events is critical, or where duplicates can’t be tolerated. FIFO queues also provide exactly-once processing but have a limited number of transactions per second (TPS).
This figure easily helps to visualize the difference between the two. Note- here M1,M2,M3 are the messages which have been passed.
Functionality
- Unlimited queues and messages: Create unlimited Amazon SQS queues with an unlimited number of message in any region.
- Payload Size: Message payloads can contain up to 256KB of text in any format. Each 64KB ‘chunk’ of payload is billed as 1 request. For example, a single API call with a 256KB payload will be billed as four requests.
- Batches: Send, receive, or delete messages in batches of up to 10 messages or 256KB. Batches cost the same amount as single messages, meaning SQS can be even more cost effective for customers that use batching.
- Long Polling: Reduce extraneous polling to minimize cost while receiving new messages as quickly as possible. When your queue is empty, long-poll requests wait up to 20 seconds for the next message to arrive. Long poll requests cost the same amount as regular requests.
- Retain messages in queues for up to 14 days.
- Send and read messages simultaneously.
- Message locking: When a message is received, it becomes “locked” while being processed. This keeps other computers from processing the message simultaneously. If the message processing fails, the lock will expire and the message will be available again.
- Queue sharing: Securely share Amazon SQS queues anonymously or with specific AWS accounts. Queue sharing can also be restricted by IP address and time-of-day.
- Server-side encryption (SSE): Protect the contents of messages in Amazon SQS queues using keys managed in the AWS Key Management Service (AWS KMS). SSE encrypts messages as soon as Amazon SQS receives them. The messages are stored in encrypted form and Amazon SQS decrypts messages only when they are sent to an authorized consumer.
- Dead Letter Queues (DLQ): Handle messages that have not been successfully processed by a consumer with Dead Letter Queues. When the maximum receive count is exceeded for a message it will be moved to the DLQ associated with the original queue. Set up separate consumer processes for DLQs which can help analyze and understand why messages are getting stuck. DLQs must be of the same type as the source queue (standard or FIFO).
Benefits:
1. Eliminate administrative overhead
AWS manages all ongoing operations and underlying infrastructure needed to provide a highly available and scalable message queuing service. With SQS, there is no upfront cost, no need to acquire, install, and configure messaging software, and no time-consuming build-out and maintenance of supporting infrastructure. SQS queues are dynamically created and scale automatically so you can build and grow applications quickly and efficiently.
2. Reliably Deliver Messages
Use Amazon SQS to transmit any volume of data, at any level of throughput, without losing messages or requiring other services to be available. SQS lets you decouple application components so that they run and fail independently, increasing the overall fault tolerance of the system. Multiple copies of every message are stored redundantly across multiple availability zones so that they are available whenever needed.
3. Keep sensitive data secure
You can use Amazon SQS to exchange sensitive data between applications using server-side encryption (SSE) to encrypt each message body. Amazon SQS SSE integration with AWS Key Management Service (KMS) allows you to centrally manage the keys that protect SQS messages along with keys that protect your other AWS resources. AWS KMS logs every use of your encryption keys to AWS CloudTrail to help meet your regulatory and compliance needs.
4. Scale elastically and cost-effectively
Amazon SQS leverages the AWS cloud to dynamically scale based on demand. SQS scales elastically with your application so you don’t have to worry about capacity planning and pre-provisioning. There is no limit to the number of messages per queue, and standard queues provide nearly unlimited throughput. Costs are based on usage which provides significant cost saving versus the “always-on” model of self-managed messaging middleware.
CONCLUSION
So Finally through this blog We can say that AWS SQS Service playing the vital role for solving the Real Use cases in Industry by providing extremely high message durability, giving us and the stakeholders added confidence.