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

brightball
Since the comments are turned off on the YouTube videos, I’m going to post on talk per day on here for viewing and discussion…starting wi...
New
axelson
ElixirConf 2017 - HTTP 2 Plug to Phoenix Cowboy too - @Gazler In this talk, we will look at the changes in C...
New
kokolegorille
Hi everyone, It seems Elixir conf 2018 are starting to pop up on Youtube… Not really an index file, but You can start here
New
axelson
ElixirConf US 2018 – Growing Applications and Taming Complexity – Aaron Renner (@aaronrenner) Growing an ap...
New
axelson
by @girlsleuth Whether you call it UI testing, End-to-End Testing, End-to-User Testing, or Acceptance Testing–it is often an intensely ...
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
ElixirConf
ElixirConf: ElixirConf 2023 - Charlie Holtz - Building AI Apps with Elixir Comments welcome! View the <span class="hashtag-icon-placehol...
New

Other popular topics Top

nobody
Hi! In PHP: $_SERVER[‘SERVER_ADDR’] - in Elixir? Searched the docs for ip address and the web, no good results. Thanks!
New
hariharasudhan94
Lets say I have map like this fetching from my database %{"_id" =&gt; #BSON.ObjectId&lt;58eb1a7a9ad169198c3dXXXX&gt;, "email" =&gt; ...
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
AngeloChecked
What learn first? Rust or Elixir Hi Elixir community! I’m here because i want learn a new language. I’m a junior developer and mainly i ...
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
JorisKok
I have a server on AWS, and was running a load test using artillery. When looking at the Phoenix dashboard I see the Ports going to 100% ...
New

We're in Beta

About us Mission Statement