Message Queue Implementation with Amazon MQ

Meherchaitanya
3 min readMar 1, 2021

Introduction

Message Queue is a middleware concept which is used to handle the message flow by maintaining the cache of the message. They are stored in the queue until the message is processed and then it is deleted. This is required in larger apps where the flow of the messages will be higher to handle for the servers even though they have auto scaling, the server takes a couple of seconds to scale and we don’t want these messages to be lost. So we use a message queue middleware to keep up with the messages to ensure that no message is lost due to large number of input.

SQS or Simple Queue Service is an implementation of the message queue by AWS which is fully managed hosted service. Now below are the case studies of AWS SQS

Case Study: Red Bus

The Red Bus company is an Indian travel agency that specializes in bus travel throughout India by selling bus tickets throughout the country with a mobile app of Red Bus or through some agent partners. Red Bus also provides SaaS (Software as a Service) by providing their software to private bus companies to handle their own ticketing and managing their own inventories.

Challenge

When a service that big which is used all over the Country, there will be large amount of requests that may come at once and the infrastructure may not be able to effectively handle it. Message queue was a solution for this problem. They need an application that can cache the requests that came and hold the messages till they are processed.

Reason to choose AWS

After testing the AWS solution on a small application for several months, the travel agency determined that it was very workable and convenient. Although Red Bus was quite enthusiastic about the on-demand instances and variety of instance types, several other features cemented the company’s decision to migrate completely to AWS. These features included the ability to easily manage access to servers through security groups, the easy-to-use, self-service management console, the concept of Elastic IPs, and superior support.

The company has incorporated many of the AWS products into its solution, including Amazon Elastic Compute Cloud (Amazon EC2), Elastic Load Balancing, Amazon Relational Database Service (Amazon RDS), Amazon Simple Storage Service (Amazon S3), Amazon Elastic Block Store (Amazon EBS), and Amazon CloudWatch. Charan Padmaraju, Chief Technology Officer believes that “with features like Elastic Load Balancing and multiple availability zones, AWS provides the required infrastructure to build for redundancy and auto-failover. When you incorporate these in your system/application design, you can achieve high reliability and scale.”

The Benefits

Since migrating to AWS, Red Bus 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 Red Bus 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.

--

--

Meherchaitanya
Meherchaitanya

Written by Meherchaitanya

Love DevOps and Web Development

No responses yet