When to use AWS SQS (Messaging Channel)

When to use AWS SQS (Messaging Channel)

SQS:

SQS is a messaging solution that's used in the situation when one component of our software system needs to communicate to the other one without relying on each other.

Best Analogies:

In our daily life, we come across situations in which our information consumption rate is different than the rate it's produced. For example, sitting in a class where teacher needs to cover a big topic in one-hour long session. She produced at a speed we, as students, cannot cope and ultimately we lack behind the concept :-)

Similarly, if I ask my friend to unload the packages from the truck and give it to me while I would unpack as I receive. The chances are I might get behind because I need more time to unpack the package. I might take even more time on some packages if the package size is different or packed in a different way.

In the above package example, the potential solutions could be as follows:

  1. Either I increase my rate of receiving/unpacking the packages from my friend.
  2. My friend slows down delivering the packages to me. He is very busy and has some other jobs to be done for the day :-). So, he would most probably get annoyed with this approach.
  3. OR I have my friend put the packages on the table and I would pick it from there.

Out of 3, the last solution seems practical in which we both are happy. If I need, I could take more help from my other friends to help me unpacking the packages from the table if the table is more than 50% filled.

Our computer systems are no different than these analogies. One component produces the information at a rate quicker than the other component or vice versa. And in order to make both of the components happy, we put a messaging queue in between. Producer puts the messages to the queue at its rate whereas consumer consumes it from the queue at its rate. Both components operate independent to each other and none of the component pulling the other's component leg down, the system performs efficiently without any bottleneck.

So, by putting the messaging queue in between, we achieved decoupling and performance boost. Furthermore, we can attach multiple same type of consumers to the queue in the situation when we notice the queue has more than 100 messages to be processed. We can pull off extra consumers once the queue is back to under 50 messages. In this way, we can scale our system up/down depending upon the load.

要查看或添加评论,请登录

Asim Arif的更多文章

  • Short Poll, Long Poll vs Callback

    Short Poll, Long Poll vs Callback

    Imagine you're on a long road trip with your family. It's a bright, sunny day, and the car is packed with snacks…

    3 条评论
  • The Circuit Breaker Design Pattern

    The Circuit Breaker Design Pattern

    The circuit breaker design pattern is a useful concept in the world of microservices architecture. What is a Circuit…

  • Solving Dual Write Problem in Event Driven Systems

    Solving Dual Write Problem in Event Driven Systems

    Imagine you're trying to keep two completely independent systems up to date almost at the same time. One system stores…

    4 条评论
  • Enhancing Scalability: Leveraging Partial Batch Response in SQS with Lambda

    Enhancing Scalability: Leveraging Partial Batch Response in SQS with Lambda

    Introduction Efficient and scalable message queuing systems are critical for businesses scaling their operations…

  • Battle between Cloud Agnostic and Cloud Native Solutions

    Battle between Cloud Agnostic and Cloud Native Solutions

    When it comes to building and deploying applications in the cloud, there are two main approaches: cloud agnostic and…

  • Amazon Event Bridge, when to use it?

    Amazon Event Bridge, when to use it?

    Amazon Event Bridge is a fully managed event bus service offered by Amazon Web Services (AWS). It allows you to send…

  • When to use Pub/Sub Model

    When to use Pub/Sub Model

    In a distributed application development, we come across situations in which the message produced by the producer must…

  • Defining Common Layers in #serverless applications

    Defining Common Layers in #serverless applications

    Writing brand new #serverless applications from scratch or migrating from existing monolithic ones - the developers…

    1 条评论
  • Let AWS Lambda monitor your Domain's SSL Expiry Date

    Let AWS Lambda monitor your Domain's SSL Expiry Date

    Although, there have been countless use cases for AWS Lambda Functions. But recently, I came across a problem.

社区洞察

其他会员也浏览了