Industry UseCase For AmazonSQS

Industry UseCase For AmazonSQS

What is AmazonSQS ?

No alt text provided for this image

Instead of running everything on servers, one can leverage AWS services for better performance and achieving objectives. One such helpful service is Amazon SQS.

Amazon Simple Queue Service (SQS) is a fully managed message queuing service in AWS cloud that enables software applications to implement queing services in microservices, distributed systems, and serverless applications. SQL is scalalbe. Using SQS, you can send, store, and receive messages at any volume, without losing messages or requiring other services to be available. 

Amazon Simple Queue Service (SQS) is a fully managed message queuing service that enables you to decouple and scale microservices, distributed systems, and serverless applications. SQS eliminates the complexity and overhead associated with managing and operating message oriented middleware, and empowers developers to focus on differentiating work. Using SQS, you can send, store, and receive messages between software components at any volume, without losing messages or requiring other services to be available. Get started with SQS in minutes using the AWS console, Command Line Interface or SDK of your choice, and three simple commands.

SQS offers two types of message queues. Standard queues offer maximum throughput, best-effort ordering, and at-least-once delivery. SQS FIFO queues are designed to guarantee that messages are processed exactly once, in the exact order that they are sent.

How does SQS work 

SQS It is used to decouple various components of the application. To understand in simple terms, it is like a buffered storage in between various software components. 

 To understand the concept how SQL works, let's discuss with a use case.

 Consider a sender component ‘A’ and receiver component ‘B’. Now A is sending a messages to B at a higher rate than the rate receiver B can process. This creates a serious problem of losing messages in transit. 

No alt text provided for this image

To prevent messages getting lost, a SQS queue can be introduced to act as a buffer to prevent loss of messages. The messages are stored in the queue in transit and then delivered to the receiver.

No alt text provided for this image

This is one of the use-cases for SQS, other use cases can be decoupling the application, asynchronous processing etc.

Key features of SQS

 SQS is a cloud service and can be used by any type of software, application, or other service. SQS works at its own independent service in the cloud. A software connects with SQS using a connection by passing the credentials and queue names. SQL also allows applications to create and delete custom queues. 

  • At-Least-Once Delivery - A message in the queue is delivered at least once. Message delivery is guaranteed, no message is lost.[Text Wrapping Break]
  • Multiple components can work on a single queue. SQS uses a lock mechanism, if one component is using a message, it is made hidden to other components. Upon successful processing, message is deleted from the queue. If the message processing fails, it stays in the queue and is made visible to all the components. This feature is called Visibility Timeout.
  • There are two types of queues - Standard and FIFO. In standard queue the messages are picked up randomly. It might not be in the order it entered the queue while FIFO queue uses first-in-first-out, it ensures the order.
  • For the messages that cannot be processed are kept in dead-letter queue.
  • Billing is done based on the number of requests to the queue. SQS is a good service to be used for applications to increase efficiency, reliability and performance. 

Benefits

Eliminate administrative overhead

AWS manages all ongoing operations and underlying infrastructure needed to provide a highly available and scalable message queuing service. With SQS, there is no upfront cost, no need to acquire, install, and configure messaging software, and no time-consuming build-out and maintenance of supporting infrastructure. SQS queues are dynamically created and scale automatically so you can build and grow applications quickly and efficiently.

 Reliably deliver messages

Use Amazon SQS to transmit any volume of data, at any level of throughput, without losing messages or requiring other services to be available. SQS lets you decouple application components so that they run and fail independently, increasing the overall fault tolerance of the system. Multiple copies of every message are stored redundantly across multiple availability zones so that they are available whenever needed.

Keep sensitive data secure

You can use Amazon SQS to exchange sensitive data between applications using server-side encryption (SSE) to encrypt each message body. Amazon SQS SSE integration with AWS Key Management Service (KMS) allows you to centrally manage the keys that protect SQS messages along with keys that protect your other AWS resources. AWS KMS logs every use of your encryption keys to AWS CloudTrail to help meet your regulatory and compliance needs.

Scale elastically and cost-effectively

Amazon SQS leverages the AWS cloud to dynamically scale based on demand. SQS scales elastically with your application so you don’t have to worry about capacity planning and pre-provisioning. There is no limit to the number of messages per queue, and standard queues provide nearly unlimited throughput. Costs are based on usage which provides significant cost saving versus the “always-on” model of self-managed messaging middleware.

Case studies

redBus Case Study

No alt text provided for this image

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.

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%.”
Charan Padmaraju
Chief Technology Officer, redBus

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.

Why Amazon Web Services

After testing the AWS solution on a small application for several months, the travel agency determined that it was very workable and convenient. Although redBus 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 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.

Conclusion

Use Amazon SQS to transmit any volume of data, at any level of throughput, without losing messages or requiring other services to be available. SQS lets you decouple application components so that they run and fail independently, increasing the overall fault tolerance of the system.

To view or add a comment, sign in

More articles by Vaibhav Jain

Insights from the community

Others also viewed

Explore topics