What is Amazon SQS?

2022.06.13

この記事は公開されてから1年以上経過しています。情報が古い可能性がありますので、ご注意ください。

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:

  1. Standard Queue
  2. FIFO Queue

Standard 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.

Delivery Indifference

A message is delivered at least once, but sometimes more than one copy is delivered.

Processing Duplicate

Occasionally, a message is delivered in more than one copy.

They may also be delivered in a different order than they were sent.

FIFO Queue

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.

Transaction Limitation

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.

Conclusion

The key advantage of Amazon SQS is that it allows for asynchronous message-based communication, which makes it better than API calls.