Support Documents

Introduction to Simple Queuing Service (SQS)

Lab Details

  1. This lab will walk you through the steps to create and manage Queues by explaining all the basics needed.

  2. Duration: 45 minutes

  3. AWS Region: US East (N. Virginia) us-east-1


SQS(Simple Queue Service)

Fun Fact: This was the first-ever AWS service offering made publicly available.

  1. Amazon SQS is a reliable, easy to manage,  scalable queuing service. SQS is a simple and cost-effective cloud application.

  2. 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.

  3. 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. 

  4. 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.

  5. 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.

  6. The default Amazon SQS ensures that each message is delivered at least once.

  7. There are two types of Queues:

Architecture Diagram

Case Study:

  1. 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.

  1. 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.

  2. 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.

  1.  When you have a single consuming application for the queue's output, this is easy to process. It will receive the messages, do its processing and deletes the messages. Now the consuming application is ready to process the next batch of the messages.You can also add an auto scaling group to scale your processing power depending upon the requirements.

Note: SQS won’t release the next batch of messages until the first batch has been deleted.

Task Details

  1. Log in to the AWS Management Console.

  2. Create FIFO and Standard Queue using the Console.

  3. What is Long Polling and configuring Long Polling for the queue.

  4. What is Visibility Timeout and configuring Visibility Timeout.

  5. What is Delay Queue and configuring Delay Queue.

  6. Purge Queue and verify the same.

  7. SQS points to remember.

  8. Validation of the lab.