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 - Streaming Video with Elixir - @johnwahba Running a video stream is challenging. You can’t ...
New
New
axelson
ElixirConf 2017 - Day 2 Morning Keynote - @josevalim All talks are available in the Elixir Conf 2017 Talks Li...
New
axelson
ElixirConf US 2018 – Making a GraphQL Server with Absinthe & Dataloader – Aaron Votre (@shamshirz) The ...
New
axelson
by @zacky1972 Finally, we’ve succeeded in the implementation of Hastega!!! (Maybe until ElixirConf US 2019 :slight_smile: Hastega (Hyp...
New
axelson
ElixirConf US 2018 – Texas: Virtual DOM Library for Server-Side V-DOM. – Dan McGuire (@dgmcguire) Client-si...
New
AstonJ
File uploads are an essential part of many web applications, but often handling them can be tricky, which explains why they are one of th...
New
axelson
ElixirConf US 2018 – Building Video Chat with Elixir & Phoenix – Anil Wadghule (@anildigital) In this t...
New
CodeSync
Code Sync: Celebrating the 10 Years of Elixir | José Valim | ElixirConf EU 2022 Comments welcome! View the <span class="hashtag-icon-pl...
New
rodrigues
Day 1 Keynote about Lumen - An alternative BEAM implementation, designed for WebAssembly by @rcm765 @KronicDeth @bitwalker...
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
WestKeys
Currently suffering from paralysis by [HTTP client] analysis. This is rather unusual in Elixirland as there tends to be consensus on the ...
New
marius95
Hello everyone, I try to use an Javascript Event Handler in my root.html.leex file. Therefore I created a function in the app.js file: ...
New
chrismccord
This release brings a number of exciting features, including integration with the new Phoenix LiveDashboard and Phoenix LiveView. There h...
New
freewebwithme
Using vs code and installed ElixirLS: support and debugger. And I got an error popped up on start up says Failed to run ‘elixir’ comma...
New
bsollish-terakeet
Credo is smart enough to check for (something like) this: assert length(the_list) == 0 with this response: Checking if an enum is empt...
New
klo
Got a question about when to concat vs. prepending items to list then reversing to achieve appending. So i know lists boil down to [1 | ...
New
AstonJ
We’ve put together this wiki for Phoenix LiveView - please feel free to add any info you feel is worth including. What is Phoenix LiveV...
New
Qqwy
Update: How to use the Blogs &amp; Podcasts section You can post links to your blog posts or podcasts either in one of the Official Blog...
3271 127089 1222
New
vonH
In asking this question I am more interested about the expressiveness of the language itself and less concerned about the availability of...
New

Latest on Elixir Forum

We're in Beta

About us Mission Statement