3 ms·
I've been working on the Protohackers [1] exercises in Elixir, putting my own spin on the problems by creating fault tolerant, scalable, high performance soluti
by Dowwie 3y ago
I've been working on the Protohackers [1] exercises in Elixir, putting my own spin on the problems by creating fault tolerant, scalable, high performance solutions-- and have been touching a lot of Elixir that I haven't had the opportunity to otherwise. The "Unusual Database" problem, particularly, has become a very deep rabbit hole assignment as it involves a UDP-based KV database. I stopped just short of clustering.
Writing servers in Elixir is straightforward because of the foundation exposed by Erlang's gen_tcp and gen_udp libraries. When you want to take your TCP server up a notch, try TCP acceptor pooling. There are two viable TCP acceptor pool libraries: Thousand Island, written in pure Elixir, and Ranch, written in Erlang.
Because of these well- abstracted foundation libraries and acceptor pool libraries, it's possible to write robust servers without venturing much into low level network programming. Beej explains the lowest level details well. I've done some of the equivalent work in Rust but found the slow progress of my work unsatisfying and moved back to Elixir quickly.
[1] protohackers.com