4 ms·
There is another type of application where Elixir/Erlang really shines. The most obvious example of this type of application is a web based game where you have
by bcrosby95 7y ago
There is another type of application where Elixir/Erlang really shines. The most obvious example of this type of application is a web based game where you have thousands of instances of the game running at once. The concurrency and isolation model is pretty much a perfect fit for this.
I was trying to hack something together in Java that wouldn't kill the database. Queries to table x would bottleneck, then table y. Add some caching here and there as each problem cropped up. But the obvious design in Elixir just removed most of the problems - each instance of the game works as its own set of processes and each instance holds what it needs in memory. It's not that I couldn't have arrived at this model with Java eventually, but it doesn't exactly lead you there, and a language like Elixir/Erlang was basically built with this in mind so everything is a lot easier to accomplish than with something like Java.
I really think everyone should learn either Elixir or Erlang. There are certain applications where OTP and BEAM just makes everything so much easier than the alternatives. If you have the right problem it can be an insanely productive language.
- cultofmetatron 7y agoI had one case where I needed to store account data and ended up storing it in a gen server object for each account which pushed its state to all devices logged into that account. It was so easy to build I forgot about it but this 4-hour project would have taken over a week if I had done it in any other language.