97 points · by brazeepd · 7y ago · 34 comments
Making reliable distributed system in the presence of software errors
http://erlang.org/download/armstrong_thesis_2003.pdf
If the subject of "resiliency with queues" is interesting to you, then what Joe Armstrong wrote will definitely be interesting to you.
Have you written anything about it?
This still isn't any better than the initial example. It could still crash between sending the message and enqueueing the second job. So it may still send out the same message twice.
This may be tongue-and-cheek, but it is not true. That is a great example of a scenario where it is okay to lose messages. The consequences are extremely low if one a billion people is not notified that their food is ready.
It's not, if a client is in trail with your service and they miss a message you risk losing that client. It's only "Okay" to not deliver on non-client facing services. Anything else is an unmeasurable risk
And that kind of absolutism in technology is the source of a common failure to meaningfully deal with failure modes of your technology.
Losing one in a billion messages telling someone their food is ready can be offset by $100 in marketing budget to buy that person a very nice meal in compensation. We know how to deal with hospitality failures like that, it’s not actually complicated.
Spending the effort to reduce the failure below that is not worth the cost, which is certainly more than $100. There’s almost certainly better usages for those developer resources.
I disagree. The ability to handle data loss comes from the nature of the data, not whether it is client-facing or not. Banking transactions can almost never handle message loss, whether it is client-facing or not. On the other hand, a meal notification service could drop one or two messages and still work properly.
How do they signal the workers to refresh their dynamic queue lists?
Are they using a homebuilt queueing system or piggybacking on top of something like celery?
What is the underlying message bus and how is it deployed?
Would love to know more. Also kudos to them for stressing idempotency in a message system. It's usually much easier to ensure idempotency than to ensure exactly once delivery.
> Are they using a homebuilt queueing system or piggybacking on top of something like celery?
They prolly do. Other comments mention erlang. I don't know if braze use Erlang. After reading the dissertation about it http://erlang.org/download/armstrong_thesis_2003.pdf and my xp with Celery, it is clear that they have their own queueing system, maybe based on erlang. My understanding is that in erlang systems workers have much more knowledge than Celery workers about what happens in the whole system.
Celery workers are very simple: they poll for tasks in a single statically defined queue. There is no sens of priority, it's a FIFO queue. You emulate priorities with several queues each of which have a number of worker proportional to their priority. That's not that simple because it depends on the kind of tasks they must execute (e.g. how many times it takes to execute, kind of resources required by the task (RAM, CPU, IO, GPU)).
At the end of the day, I am not happy with Celery + RabbitMQ. I am also looking for dynamic queueing systems [0].
Every other queue system I’ve encountered has terrible failure modes, buggy clients, weak semantics, and huge serialization overhead.
http://mikehadlow.blogspot.com/2012/04/database-as-queue-ant...
Transactions make the problem worse with locking.