When two services needed to communicate in the past, one service would make an api call to notify the other service that something had changed or that an action had been taken.
The event or notification-producing service can use Amazon Simple Queue Service (SQS) to asynchronously notify the consumer that something has changed in its system, allowing for a very clean decoupling of these two services.
Types Of SQS There are two types of SQS:
- Standard Queue
- FIFO Queue
The throughput of a standard queue is infinite. This implies that the processing rate is infinite.
You can execute almost an infinite number of transactions per second.
A message is delivered at least once, but sometimes more than one copy is delivered.
Occasionally, a message is delivered in more than one copy.
They may also be delivered in a different order than they were sent.
To begin with, FIFO Queue stands for first in, first out. It functions in the same way as its name suggests. What arrives first is processed first.
Processing In Exact Order
Messages are received and sent in strict chronological order.
Messages are also delivered sequentially, eliminating the possibility of out-of-order processing.
Because there is a TPS (transactions per second) limit, there is no such thing as unlimited throughput. You have a limit with a maximum of 300 tps.
You can, however, use batching to publish to SQS with up to 10 messages in a batch while only using one api operation.
As a result, if you use ten messages per batch, you can publish 3000 tps instead of 300.
The key advantage of Amazon SQS is that it allows for asynchronous message-based communication, which makes it better than API calls.