Search code examples
amazon-web-servicesamazon-sns

On what condition can AWS SNS Standard topic deliver more than one message which is not allowed in FIFO topic


Can anybody explain in distributed computing terms, as why AWS SNS Standard topic can deliver more than one message, while this is strictly not allowed in SNS FIFO topics. Whats the architecture behind?

The documentation says:

**Best-effort deduplication**: 
A message is delivered at least once, but occasionally more than one copy of a 
message is delivered.

Solution

  • It think the short polling in SQS illustrates why distributed systems sometimes work differently then fully centralized:

    When you consume messages from a queue using short polling, Amazon SQS samples a subset of its servers (based on a weighted random distribution) and returns messages from only those servers. Thus, a particular ReceiveMessage request might not return all of your messages

    AWS does not share exact details of its internal architectures, but I think similar situation may explain why SNS may deliver duplicate messages. Namely, some servers the support the SNS may not receive a notification that a given msg has been deliver in time, and re-send it.

    SNS FIFO requires probably a centralized system to manage the msgs, but at the same time it has lower throughout then non-FIFO.