Sagas in Erlang: Distributed Transactions Without Locks

Mark Allen
Distributed systems dilettante

Sagas are a technique described in a 1987 paper by Hector Garcia-Molina in the context of long-lived database transactions. Sagas provide a transactional abstraction across arbitrarily distributed services: either all of the operations in a Saga succeed or the operations are unwound back to the prior state. The idea never caught on in the world of databases, but 30 years later it is worth re-evaluating this idea when we need to provide transactional state changes across a variety of distributed microservices. 


This talk presents the four types of Sagas outlined in the '87 paper and then introduces an implementation of one of those techniques in Erlang. The talk finishes with an overview of how to write your own property based tests which help assure correctness and robustness in implementation.

Talk objectives:

  • What Sagas are, how they might be implemented in Erlang, an overview of property based testing.

Target audience:

  • Intermediate to advanced Erlang and/or Elixir programmers

Slides
Video

Mark has been a programmer for more than 20 years. In the past 5 years he has been writing Erlang more or less continuously for his day job. These days Mark considers himself a passionate functional programming enthusiast.


GitHub: mrallen1

Twitter: @bytemeorg

Back to conference page