ExitFan-Out: scalable real-time delivery1 / 9
Explanation

Match once, buffer each delivery branch

How to distribute each event to matching real-time recipients using independently buffered delivery branches and bounded concurrency to isolate slow or failed recipients. · advanced

A real-time fan-out path needs two decisions: which branches match an event, and which live connections inside those branches may receive it. Here, an existing producer publishes through the Amazon SNS Publish API to a topic ARN. SNS subscription filters select delivery branches; separate SQS standard queues retain each matching branch's copy. Workers sharing one queue divide work rather than each receiving a copy.

The diagram starts at the topic and ends at connected recipients. A separately maintained, indexed registry maps authorized subscriptions to connection IDs. Each worker queries only its branch and the event's tenant and subject, then calls the API Gateway Management API. A connection ID is an address, not proof of authorization. Arrows show forward delivery and lookup requests, not responses or connection-registration traffic.

These interfaces matter: EventBridge does not accept SNS Publish requests addressed to a topic ARN. Kinesis Data Streams provides a replayable stream, not an SQS queue with visibility timeouts and message deletion; Lambda execution is not a durable queue either. AppSync offers a different real-time interface, not API Gateway's PostToConnection operation.

Delivery branch A
Delivery branch B
matching eventsmatching eventsevent batchesevent batchesrecipient queriesrecipient queriesconnection postsconnection postsWebSocket messagesexhausted messagesexhausted messages
Amazon Simple Notification Service (Amazon SNS)Event topic: filtered subscriptions
Amazon Simple Queue Service (Amazon SQS)Branch A: standard queue
Amazon Simple Queue Service (Amazon SQS)Branch B: standard queue
AWS LambdaA delivery worker: capped concurrency
AWS LambdaB delivery worker: capped concurrency
Amazon DynamoDB tableAuthorized subscription and connection registry
Amazon API GatewayWebSocket API: PostToConnection
UsersMatching connected recipients
Amazon Simple Queue Service (Amazon SQS)A processing DLQ
Amazon Simple Queue Service (Amazon SQS)B processing DLQ

1 / 8 The SNS topic accepts a published event. Its subscription policies select branches using event attributes or the message body.

AWS architecture icons are the property of Amazon Web Services. BlowStack is not affiliated with or endorsed by AWS.