axelson

axelson

Scenic Core Team

37) ElixirConf US 2018 – Event Sourcing in Real World Applications: Challenges, Successes and Lessons Learned. – James Smith

ElixirConf US 2018 – Event Sourcing in Real World Applications: Challenges, Successes and Lessons Learned. – James Smith

Our client came to us wanting to build a real time auction application for supplying fuel to ships.

This was exciting! We were going to be auctioning upwards of 1000 metric tons of fuel using Elixir and Phoenix! What could go wrong?

From the beginning of the project there was a hard requirement for auditing. Anything that happened in the system needed to be recorded. This lead us to the idea of Event Sourcing.

What is Event Sourcing?
Event Sourcing is a way of ensuring all changes to an application’s state are stored as a sequence of events. Those events can be queried, logged and used to reconstruct past states.

In this talk I’ll cover the benefits and challenges with Event Sourcing and the solutions we came up with.

Benefits:

  • Predictability. Having a list of Events helped us to troubleshoot and reason about the state of our application.
  • *Testability. Using events to start the application in a desired state made Test setup easier.
  • *Resiliency. The ability to rebuild the state of any auction at any time made our application more resilient. An auction crashing during the bidding process was no longer as scary.

Challenges:

  • Complexity. Early on we struggled with deciding to implement the pattern ourselves or use a library. After trial and error we thought through our domain, and chose to implement it ourselves. This had both benefits and draw backs.
  • Ordering. The order in which things happened our system was important. Ordering events across multiple asynchronous processes was complex.
  • Race Conditions. Dealing with timers that trigger events without race conditions was difficult.
  • This project was both fun and challenging. I want share the knowledge that we gained from it, as well as our mistakes.

Audience: Intermediate, Advanced
Topics: event-sourcing, event-storming

All talks are available in the ElixirConf US 2018 Talks List or via the elixirconf2018 tag

Where Next?

Popular in Talks Top

axelson
ElixirConf 2017 - Keep an Eye on the Sky with Nerves and Phoenix - @electricshaman As part of the next gener...
New
JuanjoA
Hi, I don’t know if I have the post in the right place. I put here in case you might be interested, I am not the author, I just found it...
New
axelson
by @SophieDeBenedetto LiveView’s reliance on server-rendered HTML and leveraging of bi-directional communication over WebSockets means ...
New
axelson
ElixirConf 2017 - Day 2 Morning Keynote - @josevalim All talks are available in the Elixir Conf 2017 Talks Li...
New
axelson
Here’s today’s talk: ElixirConf 2017 - Don’t Write Macros But Do Learn How They Work - by @jessejanderson ...
New
Lawrence_elixir
@voltone - Security advocate, BEAM enthusiast Learn you some ‘ssl’ for much security! Talk in three words: TLS, security, troubleshooti...
New
blatyo
Looks like videos have started to go up for ElixirConf US 2018. Here’s the playlist of ones available so far. I expect it’ll get updated ...
New
New
axelson
I really like the idea of discussing one Elixirconf talk each day and since @brightball hasn’t posted the second talk I’ll post it. Elix...
New
axelson
ElixirConf US 2018 – We’re Just Getting Started - Our Three Years with Elixir – Maciej Kaszubowski (@mkaszubowski) ...
New

Other popular topics Top

aadeshere1
I have a another noob question about loop. Since elixir is immutable, while loop is not directly possible. total = 10 while total != 0 ...
New
Darmani72
If I have a post route which an argument: post /my_post_route/:my_param1, MyController.my_post_handler How would get the post params ...
New
Nvim
Anybody knows a comprehensive comparison of Django and Phoenix, thanks for the help. Where are they similar? Where do they differ the m...
New
pmjoe
I have a relationship of love and hate with Elixir. Lots of things are just absolutely right, but there are some things that are kind of ...
New
belgoros
I’m not a pro in using Regex and can’t figure out why the following behaviour happens, especially if we take into account the difference ...
New
RisingFromAshes
I’ve read in another post that it may be possible with a router helper - but I couldn’t find an appropriate one, and tbh, I’m still just ...
New
fayddelight
I tried installing elixir 1.11.2 erlang 23.3.4 via asdf in my zsh shell. Enabled the versions locally and globally. When I list them ...
New
Qqwy
Original source of discussion: This topic on the Pragmatic Programmers’ Functional Web Development with Elixir, OTP, and Phoenix forum. ...
New
jason.o
In the code below, if the create action is not set to accept “extra_key” as an input, it errors out with a message shown above. Is there ...
New
openscript
Hello! Sorry for this astonishing simple question, but I’m really stuck. I try to set up the intellij-elixir plugin, but I don’t know ho...
New

We're in Beta

About us Mission Statement