Live data from Hacker News

Delivering Billions of Messages Exactly Once

segment.com

21–30 of 141 posts

Re: Delivering Billions of Messages Exactly Once

#21

Would something like AWS SQS not scale for something like this? We currently push about 25k daily transactions over SQS, obviously no where near the scale of this, just wondering about what limitations we will bump into potentially.

SQS is not "exactly once", so might not meet their requirements.

sqs has fifo queues which claim to be exactly once

Re: Delivering Billions of Messages Exactly Once

#22
post #20

"Exactly once" model of message is theoretically impossible to do in distributed environment with nonzero possibility of failure. If you haven't received acknowledgement from the other side of communication in the specified amount of time you can only do one of two things: 1) do nothing, risking message loss 2) retransmit, risking duplication But of course that's only from messaging system point of view. Deduplicatio…

An overview of FLP Impossibility

http://the-paper-trail.org/blog/a-brief-tour-of-flp-impossib...

Re: Delivering Billions of Messages Exactly Once

#23
post #17

If the OP doesn't mind expanding a little on this bit, I'd be grateful. > If the dedupe worker crashes for any reason or encounters an error from Kafka, when it re-starts it will first consult the “source of truth” for whether an event was published: the output topic. Does this mean that "on worker crash" the worker replays the entire output topic and compare it to the rocksdb dataset? Also, how do you handle scaling…

I'm not the OP, but changing the number of Kafka partitions isn't a super graceful operation. You would be wise to add as many as you could reasonably need assuming one consumer thread per partition. But not too many because each one is at least two files on disk!

Re: Delivering Billions of Messages Exactly Once

#24
post #4

Earlier quoted context omitted.

It's not down

Hmm weird. I get: This site can’t be reached segment.com refused to connect. Try: Checking the connection ERR_CONNECTION_REFUSED Maybe something local to me only?

Check your ad blocker/hosts file.

In here, uMatrix just blocks the site with the message:

> uMatrix has prevented the following page from loading:

> https://segment.com/blog/exactly-once-delivery/

I checked, and one of my uMatrix hosts files includes 'www.segment.com'.

Re: Delivering Billions of Messages Exactly Once

#26

Would something like AWS SQS not scale for something like this? We currently push about 25k daily transactions over SQS, obviously no where near the scale of this, just wondering about what limitations we will bump into potentially.

SQS is not "exactly once", so might not meet their requirements.

Actually, it can be. You just pay more.

Re: Delivering Billions of Messages Exactly Once

#27
post #19

Would something like AWS SQS not scale for something like this? We currently push about 25k daily transactions over SQS, obviously no where near the scale of this, just wondering about what limitations we will bump into potentially.

(edit: incorrect, my bad, see thread)

This is wrong. There is a type of SQS queue that indeed does exactly-once. It costs more, and not the default option, but it is there.

Re: Delivering Billions of Messages Exactly Once

#28

Would something like AWS SQS not scale for something like this? We currently push about 25k daily transactions over SQS, obviously no where near the scale of this, just wondering about what limitations we will bump into potentially.

The limitations are most likely on price. For the 200B messages they've already processed in the last 3 months, that would be $100,000 total on just the SQS FIFO queue, or $33,333 per month. And that's not counting data transfer.

Re: Delivering Billions of Messages Exactly Once

#29
post #20

"Exactly once" model of message is theoretically impossible to do in distributed environment with nonzero possibility of failure. If you haven't received acknowledgement from the other side of communication in the specified amount of time you can only do one of two things: 1) do nothing, risking message loss 2) retransmit, risking duplication But of course that's only from messaging system point of view. Deduplicatio…

I agree. I wish more messaging platforms would recognize this and stop trying to paper-over the failure mode (Kafka just came out with "Exactly Once," which I think is a variant of the 2-Phase-Commit protocol, which still does not solve the problem).

My go-to for explaining to people is the Two Generals Problem https://en.wikipedia.org/wiki/Two_Generals%27_Problem

Re: Delivering Billions of Messages Exactly Once

#30
post #20

"Exactly once" model of message is theoretically impossible to do in distributed environment with nonzero possibility of failure. If you haven't received acknowledgement from the other side of communication in the specified amount of time you can only do one of two things: 1) do nothing, risking message loss 2) retransmit, risking duplication But of course that's only from messaging system point of view. Deduplicatio…

I think "exactly once" doesn't imply "non-reprocessing" (sorry for the double negative).

Meaning, you want "exactly once" and you don't want duplicates, yes. But you allow for reprocessing, provided that you have a way for deduplicating.

You want a guarantee that if the producer (at the top of your data processing pipeline) sends a message, then this message eventually corresponds to exactly 1 record in your final storage(s).

One easy-to-understand-yet-simplistic example is: send a message to kafka, use topic+partition+offset as primary key, store in a RDBMS. This is widely accepted as "exactly once", but clearly you may have multiple attempts to save the message into the db, which will fail due to the primary key integrity constrain.

Post reply on HN