Designing Data Flow in an Elixir Trading System

A look at five separate data flows inside a GenServer-per-session system and the design rules that fall out of each one: persist only what you can’t recompute, write to the database before the network call, and let each process own exactly the state it’s allowed to call canonical. The reconciliation pattern — treating an external source as truth and letting in-memory state be cheap and disposable — generalizes well beyond trading. The trading context is just where the failure modes showed up first.

5 Likes