AWS SQS — Industry Use Cases

Prakhar Lad
4 min readSep 26, 2021

Amazon Simple Queue Service is also known as the AWS SQS in the AWS cloud. It is fully managed message queues for serverless applications, micro-services and distributed systems. SQS eliminates the difficulties and burden of managing the message or notification produced by any middleware system.

It is a message queue service used by distributed system applications to exchange messages through a polling model and can be used to decouple sending and receiving components.

It supports HTTP over SSL (HTTPS) and transport layer security (TLS) protocols for security.

Using SQS you can store, send and receive messages between software services of any size, without losing messages or requiring other services to be available.

SQS provides two types of message queues →

  1. SQS Standard Queue → It provides maximum throughput, at-least-once delivery, Message Sampling, and batching.
  2. SQS FIFO Queue → It is designed to make sure that messages are forwarded exactly one time, in order that they are sent to the queue.

Benefits of Using SQS →

  • Eliminates administrative overhead → SQS is a fully managed service provided by AWS in which no role of administrator came into play again and again. This is possible because once you create the queue, behind the scene AWS managed all the backend services need to keep uptime and high availability of this service.
  • Reliable delivery messages → SQS can deliver the message of any volume with maximum throughput, without losing messages or requiring other services to be available.
  • Keep sensitive data secure → YOu can use SQS provided by AWS to exchange sensitive data between applications using server-side encryption (SSE) to encrypt each message body. It also has the facility to integrate with AWS key management (KMS) allows you to centrally manage the keys that protect SQS messages.
  • Scale elastically and cost-effectively → It provides no limit on the number of messages per queue so if the messages are more then it scale-out automatically and scale-in. This whole process is managed by the AWS engineers.

Some More Features of AWS SQS →

Visibility timeout —

  • SQS doesn’t delete the messages from the queue by itself once the message is received by the consumer because the system is distributed and there is no guarantee it will actually receive the message.
  • Consumers should delete the message by themselves from the queue when they receive the message and process it.
  • If the consumer downloads the message from the queue and processes the message and forgets to delete it then the message is available in the queue and if it is again polled by any other consumer from the same distributed system then it will create multiple spamming and this needs to be prevented.
  • SQS handles this type of situation with Visibility Timeout. SQS blocks the visibility of messages for some time when one consumer downloads the message. This visibility time is decided by the user on the basis of time taken to process and pass the delete command to the queue for the message.

Dead-letter-queue —

  • This is also a great feature provided by SQS to prevent the processing of messages many times if the consumer forgets to pass the delete command once it receives and processes the message.
  • If the consumer polls and again and again the same message then we can set delete or transfer the message somewhere so that the main queue became empty and next time if the consumer polls they don’t the same message.
  • This concept is developed using Dead-letter-queue. In this, you can make one new queue and in the main queue attach this queue in option “dead-letter-queue” by setting a maximum threshold which means maximum how much time consumers can download the same message.

Integration with Lambda —

  • SQS provides a great facility for integration with the lambda service of AWS.

Challenge Solved of redBus using AWS →

redBus is an Indian travel agency that is specialized in providing travelling bus ticket service all across the country. The company previously uses the traditional data centre by purchasing and renting its system and infrastructure.

The biggest problem was that its data centre can’t handle the request which gave a bad impact on the company.

After doing lots of testing on small applications for several months the company realizes that AWS is a reliable and better solution to switch on its infrastructure and services.

The company uses many of the AWS services like Amazon Elastic Cloud Computing, Elastic Load Balancer, Amazon Relational Database Service, Amazon Simple Storage Service, Amazon Elastic Block Store and Amazon CloudWatch.

redBus also use the Amazon Simple Notification Service and Amazon Simple Queue Service for monitoring, alerts, and intercommunication.

Thank you for reading!!

--

--