Talk: 15:50–16:35 (English)
Ordered, but not too much: events and per-key virtual actors on the BEAM
Many event-driven systems need ordering per key: events from one IoT device, one account or one aggregate must be processed in the order they were sent, while events with different keys should not wait be blocked by others. The usual answers trade one problem for another: a single consumer per queue serialises everything behind the slowest message, and partitions still make unrelated keys wait for each other. Per-key ordering asks for a total order among events that share a key, and no order at all between keys. This is a weaker promise than total ordering, but it lets everything that need not be ordered run in parallel.
Mississippi is an open-source Elixir library for ordered, distributed message processing over queueing systems (currently, AMQP). Messages are sharded across queues, and grouped by key on the consumer side. Processing happens in lightweight processes which are spawned on demand and the system makes sure to keep per-key ordering even in case of crashes. Thanks to the BEAM, these processes are spread across a cluster of nodes.
These per-key processes are close cousins of Orleans’ virtual actors. In this talk I go through the design and the invariants behind it, show what happens when channels and nodes fail, and discuss the limits and trade-offs that were found when running it in production as the message engine of an IoT platform.
Arnaldo Cesco
https://mastodon.bida.im/@annopaolo
I am a computer scientist, hiker, reader. Not necessarily in this order. I worked as a software engineer and team leader at Clea, first contributing to and then leading the development of its IoT platform. Before that, I did research on the theory of distributed systems, mainly Petri nets. I mostly write functional code (Elixir, Lean), appreciate software with solid theoretical foundations, and care about systems that keep their guarantees when things go wrong.