BT

InfoQ Homepage News Amazon SNS Supports FIFO for Pub/Sub Messaging

Amazon SNS Supports FIFO for Pub/Sub Messaging

Bookmarks

AWS has recently introduced support for First-in-First-out (FIFO) topics in Amazon SNS with strict ordering and deduplication of messages. The new feature enforces ordering in which messages are sent and received, and avoids that a message is processed multiple times.

Introduced ten years ago, Amazon SNS is a notification service that can send messages to a variety of devices and platforms but until recently it could not support use cases that require fanout of messages to multiple FIFO queues.

Christian Mueller, principal solutions architect at AWS, wrote an article on the benefits of FIFO topics and how to build event driven architectures using them:

Developers increasingly adopt event-driven architectures to decouple their distributed applications. Often, these events must be propagated in a strictly ordered manner to all subscribed applications (...) Before Amazon SNS FIFO, architects had to design applications to check if messages are received out of order before processing (...) and design receivers to be idempotent. In some cases, where the event cannot be idempotent, this requires the receiver to be implemented in an idempotent way.

An implementation is available as an example in GitHub. As a pub/sub messaging service, SNS is often used in combination with Amazon Simple Queue Service (SQS), the distributed message queuing service that since 2016 supports FIFO queues.

Source: https://aws.amazon.com/blogs/aws/introducing-amazon-sns-fifo-first-in-first-out-pub-sub-messaging

Danilo Poccia, chief evangelist EMEA at AWS, describes a few use cases where the new feature can simplify the architecture:

You can use FIFO topics and queues together to simplify the implementation of applications where the order of operations and events is critical, or when you cannot tolerate duplicates, for example, to process financial operations and inventory updates, or to asynchronously apply commands that you receive from a client device. FIFO queues can use message filtering in FIFO topics to selectively receive only a subset of messages rather than every message published to the topic.

The AWS documentation covers as well a different use case, an ecommerce platform built by a manufacturer using Amazon SNS FIFO topics and Amazon SQS FIFO queues.

AWS is not the only cloud provider supporting FIFO in notifications. Azure offers Service Bus, a messaging system for traditional enterprise applications, and Google Cloud Pub/Sub since recently supports ordering, as Michael Gasch, application platform architect at VMware, pointed out:

Nice! Right after Google Cloud Pub/Sub GA-ed FIFO support, AWS adds it to SNS.

Both standard and FIFO Amazon SNS topics support fanning out messages to multiple subscriptions with the same durability but the new FIFO topics have higher prices and limitations compared to standard ones. While standard topics support a nearly unlimited number of messages per second, FIFO topics are limited to 300 transactions per second. Each FIFO topic supports up to 100 subscriptions, while a standard one could handle up to 12.5M subscriptions. Amazon SNS FIFO is available in almost all AWS regions.

Rate this Article

Adoption
Style

Hello stranger!

You need to Register an InfoQ account or or login to post comments. But there's so much more behind being registered.

Get the most out of the InfoQ experience.

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Community comments

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

BT

Is your profile up-to-date? Please take a moment to review and update.

Note: If updating/changing your email, a validation request will be sent

Company name:
Company role:
Company size:
Country/Zone:
State/Province/Region:
You will be sent an email to validate the new email address. This pop-up will close itself in a few moments.