KishoreKarunakaran
Is Elixir and Phoenix a good choice for real time trading systems?
Is Elixir with Phoenix a good choice for building real-time stock trading systems ?
Requirements are High Availability and Low Latency.
What are your thoughts about this ?
What will be pros and cons if one uses Elixir and Phoenix in real time trading systems ?
Marked As Solved
jorinvo
Although it doesn’t seem like you really need it here, there is an interesting talk about building hard real time systems on top of the Erlang VM: https://www.youtube.com/watch?v=yjmZoAtkkLY
Even if you don’t need hard real time, the talk gives some nice insight into using NIFs and dedicated hardware to build high performance systems.
Also Liked
jakemorrison
It depends on your definition of real time. Erlang is quite popular in real time ad exchanges. Lack of garbage collection pauses give more predictable latency than some languages. It is considered “soft” real time, though.
When things need to be really fast and predictable, then C++ was popular, sometimes supervised by Erlang. That is a pretty good approach, isolating the pieces that need to be fast. Now speeds are such that things are done in silicon.
We wrote an embedded “logo inserter” box for the broadcast television industry in a mixture of Erlang and C++. The C++ handled the low level processing: pull a frame from a Blackmagic SDI interface, add an image, send it out another interface, 60 frames per second. Erlang handled everything else, and restarted the C++ if it should crash in time for the next frame. Bulletproof.
AndyL
idi527
Does Elixir with Phoenix is good choice for real-time stock trading systems ?
Depends on what you mean by this. I’ve heard success stories with c++ and erlang (c++ handled computations, erlang handled some networking). And some experiments with erlang + rust (now rust handles the computations).
I don’t quite see how phoenix fits in a trading system, though.
seamon
hmm…yes, we think it’s a good choice for trading system. we wrote https://chaince.com as mentioned above by @gonglexin (and thank you so much
) based on pure elixir/phoenix/OTP infrastructure.
we’re using phoenix channel with websocket as order submission and trading reports system, it’s very fast. we think it can be called “real time”.
as to the High Availability, it’s just the pros of OTP. there’re 12 nodes in our cluster, and the whole cluster can be rolling restarted any time we like, without any service interruption.
“elixir is a good thing, maybe the best of things, and no good thing ever DIES” 
gonglexin
Take a look at https://chaince.com/, it’s a crypto exchange which written by Elixir.








