Home > OS >  On what condition can AWS SNS Standard topic deliver more than one message which is not allowed in F
On what condition can AWS SNS Standard topic deliver more than one message which is not allowed in F

Time:12-19

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.

CodePudding user response:

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.

CodePudding user response:

In case of SNS Standard(at least one message), the client ACK may fail at times(Network failure/partition) or other cases. In case the server dosent receives ACK, it would reattempt for the same message delivery. IN these rare cases, the client might receive another copy of same message.

When AWS SNS FIFO guaratees that there is atmost one message, AWS simply has a very "Availaible" set of hardware for FIFO SNS, else in distributed system its not correct to confirm at most 1 messge. Also it must be maintaining high consistency for ordered message confirmation.

  • Related