Amazon SQS Case Study

Prabhjeet Singh
5 min readJul 30, 2022

Hello Everybody,

I hope you all fit and fine as always. So, I presented a blog for the introduction of AWS SQS and its industries use cases in many companies. I take a example of an redBus for using the AWS SQS and its usage and needs as an example in this blog.

What is Amazon SQS ?

Simple Queue Service (SQS) is a reliable, scalable, fully-managed message queuing service. SQS enables to decouple and scale microservices, distributed systems and serverless applications. SQS moves data between distributed application components and helps you to decouple these components. SQS supports both Standard and FIFO queues.

Amazon SQS automatically deletes messages that have been in a queue for more than maximum message retention period. The default message retention period is 4 days. You can set the message retention period to a value from 60 seconds to 1,209,600 seconds (14 days) using SetQueueAttributes action.

Amazon SQS Architecture

Distributed Queues -> There are three main parts in a distributed messaging system: the components of your distributed system, your queue (distributed on Amazon SQS servers), and the messages in the queue. In the following scenario, your system has several producers (components that send messages to the queue) and consumers (components that receive messages from the queue). The queue (which holds messages A through E) redundantly stores the messages across multiple Amazon SQS servers.

Message Lifecycle -> The following scenario describes the lifecycle of an Amazon SQS message in a queue, from creation to deletion.

  1. A producer (component 1) sends message A to a queue, and the message is distributed across the Amazon SQS servers redundantly.
  2. When a consumer (component 2) is ready to process messages, it consumes messages from the queue, and message A is returned. While message A is being processed, it remains in the queue and isn’t returned to subsequent receive requests for the duration of the visibility timeout.
  3. The consumer (component 2) deletes message A from the queue to prevent the message from being received and processed again when the visibility timeout expires.

Benefits of using AWS SQS

There are many useful benefits of AWS SQS in the IT industry. The following are-:

  1. Beats Administrative Overhead -> AWS SQS is capable of managing all in-progress operations and the underlying infrastructure. It is required for quality scalable and highly available message queuing service (MQS). This messaging service saves upfront costs, installation, acquisition, and configuring messaging software. There is not at all a need for these services including time-consuming built-out and infra maintenance.
  2. Elastic and cost-effective scaling -> Amazon Simple Queue Service extremely uses the AWS cloud service to dynamically scale based on requirements. Moreover, SQS scales with elasticity so that a user doesn’t need to worry about capacity planning and pre-provisioning. There is no limitation on the number of messages left per queue. Also, the general queues offer unlimited throughput. Besides, there is a significant cost saving in this model against the self-managed messaging middleware that is always-on.
  3. Reliable message delivery -> This messaging service, SQS, offers reliable message delivery without losing any messages. It helps in transmitting any volume of data with good throughput. Amazon SQS helps to separate the app components where they run and fail independently. Hence, this model enhances the failure tolerance of the existing system. It helps to store several copies of messages throughout the availability zones. This facilitates that users can use the available messages whenever they need. Further, the queue acts as a shield between the component generating data and the saving data. Then the component gets the data for processing.
  4. Securing sensitive data -> The AWS SQS offers a secure transmission service for exchanging sensitive data across applications. It uses SSE- server-side encryption that encrypts each message body thoroughly. Moreover, the integration of AWS SQS SSE with Aws Key management service allows users to centrally manage the message keys. They provide great protection to the SQS messages and also to the other AWS resources well.

redBus Case Study

redBus is an Indian travel agency that specializes in bus travel throughout India by selling bus tickets throughout the country. Tickets are purchased through the company’s Website or through the Web services of its agents and partners. The company also offers software, on a Software as a Service (SaaS) basis, which gives bus operators the option of handling their own ticketing and managing their own inventories. To date, the company says they have sold over 30 million bus tickets and has more than 1750 bus operators using the software to manage their operations.

The Challenge-> The company previously ran its operations from a traditional data center by purchasing and renting its systems and infrastructure. In addition to the expense, several logistical problems evolved from this arrangement. The biggest problem was that the infrastructure could not effectively handle processing fluctuations, which had a negative impact on productivity. Additionally, the procurement of servers or upgrading the server configuration was an extremely time-consuming endeavor. Over time, redBus realized that a better solution was imperative — a solution that offered scalability to handle the company’s processing fluctuations. redBus looked to Amazon Web Services (AWS) for a solution.

The Benefits-> Since migrating to AWS, redBus has seen measurable improvements in the bottom line. Padmaraju says, “By scaling up and down dynamically based on the load, we maintain performance as well as minimize cost. With the time savings that the IT and development staffs obtain from the AWS solution, AWS gives us an overall cost benefit of about 30–40%.” He adds, “By hosting at [the AWS Asia Pacific (Singapore) region], redBus.in gained significantly in terms of website performance by way of reduced latency (about 4x). This is a great advantage when the customers are from India.”

Of the many excellent characteristics of AWS, perhaps the most significant to redBus is the ability to “instantly replicate the whole setup on demand for testing by creating and destroying instances on demand for experimentation, thereby reducing the time to market.” Less time to market translates to increased profitability and success.

The travel agency anticipates expanding the AWS solution to include Amazon Simple Notification Service (Amazon SNS) and Amazon Simple Queue Service (Amazon SQS) for monitoring, alerts, and intercommunication. “Amazon SQS is an especially good solution for enabling messaging between external applications and our applications,” says Padmaraju.

Since joining forces with AWS, redBus has gained the freedom to experiment on new solutions and applications at minimal cost, increased the efficiency of its operations, and improved its profitability.

THANK YOU

--

--