This lab will walk you through the steps to create and manage Queues by explaining all the basics needed.
Duration: 45 minutes
AWS Region: US East (N. Virginia) us-east-1
Fun Fact: This was the first-ever AWS service offering made publicly available.
Amazon SQS is a reliable, easy to manage, scalable queuing service. SQS is a simple and cost-effective cloud application.
AWS SQS can be used to transmit any amount of data, at any level of throughput, without losing messages. It doesn’t interrupt other services when run continuously.
SQS helps to reduce administrative tasks by scaling high-available messaging clusters. While we pay only for what we use. AWS SQS helps us to save important data which could be lost if an entire application goes down or if any component becomes unavailable.
SQS queue acts as a buffer between the application components that receive the data and the other parts that process the data in the system.
SQS is used for message-oriented architecture. If the processing server cannot process the work fast enough (for whatever reason) the work is queued so that the processing servers can work on it when they have available resources to process the request. This means that work is not lost due to insufficient resources.
The default Amazon SQS ensures that each message is delivered at least once.
Consider an example of a major flash sale on an e-commerce website where people buy and sell a wide range of products. The requirement is all the requests, with respect to the buyer and seller, should be processed in the order they are received by the queue. To fulfill this requirement, we’ll be using the FIFO queue.
A mobile company is holding a flash sale for their new model with great features at the best price. It is expected that a huge number of buyers will place orders. The company is holding stock for a limited period, so it’s important to track the order that arrives first. Your flash sale receives a huge response and it is now forecasted that only the buyers who place the order first will receive the product.
Let’s understand how messages get in and out of our FIFO queue. Assume the consuming application requests a batch of up to 300 messages, AWS SQS starts filling the batch with the oldest message (REQ A1) and keeps filling the queue until the batch is full. In our case, assume the batch contains only three requests and now the queue is empty. Once the message batch has left the queue, SQS considers the batch to be In-flight until the batch gets processed completely or the visibility timeout gets expires.
Note: SQS won’t release the next batch of messages until the first batch has been deleted.
Log in to the AWS Management Console.
Create FIFO and Standard Queue using the Console.
What is Long Polling and configuring Long Polling for the queue.
What is Visibility Timeout and configuring Visibility Timeout.
What is Delay Queue and configuring Delay Queue.
Purge Queue and verify the same.
SQS points to remember.
Validation of the lab.