Elixir and Phoenix after two years
nts.strzibny.name
Elixir and Phoenix after two years
1–10 of 111 posts
Re: Elixir and Phoenix after two years
#2I have used Erlang very successfully in a semi-embedded context, but that's quite different from a web server that can usually be scaled horizontally pretty easily.
One obvious one is if you have to hold open a lot of concurrent connections like web sockets. It'd be great for that. Others?
Re: Elixir and Phoenix after two years
#3As he says, the templates are compiled and are blindingly fast compared to Rails.
Pattern matching is really really nice when used in the right places (and you'll miss it if you go back to Ruby); but it can be overused. There's a faction of Elixir folks who attempt to avoid all conditionals and instead seem to prefer multiple dispatch/multi-methods to handle different cases. That's nice and very concise, because then you can simply call a function and let the pattern matching resolve which of the various implementations you've defined handle it. The big downside here is, as a reader of the code, you have to basically mentally imagine what all cases are covered and what they mean. Sometimes simply reading a switch statement or if/else/then is much clearer.
The super special magic is in the Erlang VM. If you put more energy into learning it and its capabilities, and using it where appropriate, it can shape the structure of your greater system beyond just one webapp; and it can provide a lot of features without you having to cobble together many other (good but independent) solutions.
Lastly, single thread performance is basically a dog. In my anecdotal experience, the same external service written with Elixir+Ecto was 25-50% as performant as a Python+SQLAlchemy program. So the lesson there is, find ways to parallelize or otherwise scale your process if it is batch oriented and handling a large volume of data.
If you asked me today if I would prefer to use Elixir (and Phoenix) over Ruby and Rails, I would say yes... but honestly mostly just because it's a new fascination with different tradeoffs and a better functional story. Function is the past and the future, and it makes your life easier and simpler. Elixir as a language... borrowed too much from Ruby and has too much syntax. It is noisy in a Perl-like way, and perhaps there could be a more concise enhancement of Erlang which would get the job done and not have you spending time visually parsing code.
Re: Elixir and Phoenix after two years
#4What are people finding as the real sweet spots for Phoenix? I have used Erlang very successfully in a semi-embedded context, but that's quite different from a web server that can usually be scaled horizontally pretty easily. One obvious one is if you have to hold open a lot of concurrent connections like web sockets. It'd be great for that. Others?
I think it's also really good if you need to hold state server side for any reason.
Re: Elixir and Phoenix after two years
#5elixir and phoenix are wonderful. the phoenix liveview is a fantastic piece of technology; it moves the processing to the backend and allows the web application to be developed in the same language (mostly).
i just recently discovered microsoft blazor and it seems like it's an even better improvement. compared to liveview, the computation is moved back to the client while the development experience is still a single language. there is no more javascript (at least that's the claim) and the platform takes advantage of webassembly to deliver a high performance UX. really compelling stack. I hope it continues to drive the innovation in web development. I'm so excited to see the javascript eat dust. Maybe light at the end of the tunnel to a horrible 10+ year period of web development.
Re: Elixir and Phoenix after two years
#6What are people finding as the real sweet spots for Phoenix? I have used Erlang very successfully in a semi-embedded context, but that's quite different from a web server that can usually be scaled horizontally pretty easily. One obvious one is if you have to hold open a lot of concurrent connections like web sockets. It'd be great for that. Others?
I would reach for Rails when I'm concerned about finding developers (Elixir devs are fewer and more expensive, generally), or if there are Ruby libraries I want that aren't available in Elixir.
Re: Elixir and Phoenix after two years
#7What are people finding as the real sweet spots for Phoenix? I have used Erlang very successfully in a semi-embedded context, but that's quite different from a web server that can usually be scaled horizontally pretty easily. One obvious one is if you have to hold open a lot of concurrent connections like web sockets. It'd be great for that. Others?
The performance for typical stateless webapps is great, but honestly the thing I love is the amazing tooling and libraries. Elixir libraries are often very high quality.
Re: Elixir and Phoenix after two years
#8What are people finding as the real sweet spots for Phoenix? I have used Erlang very successfully in a semi-embedded context, but that's quite different from a web server that can usually be scaled horizontally pretty easily. One obvious one is if you have to hold open a lot of concurrent connections like web sockets. It'd be great for that. Others?
I find elixir and supporting libraries to be the best general web-dev experience of any language. Optional typing, first class documentation, ecto as a library for validations is far more successful at encouraging separation of concerns than I've seen in other CRUD webdev ecosystems. The performance for typical stateless webapps is great, but honestly the thing I love is the amazing tooling and libraries. Elixir libr…
Re: Elixir and Phoenix after two years
#9What are people finding as the real sweet spots for Phoenix? I have used Erlang very successfully in a semi-embedded context, but that's quite different from a web server that can usually be scaled horizontally pretty easily. One obvious one is if you have to hold open a lot of concurrent connections like web sockets. It'd be great for that. Others?
Other than that, I would say that any place with a complex service oriented environment where you could leverage the Erlang VM would be an obvious place to use Phoenix for doing your webapps.
Re: Elixir and Phoenix after two years
#10To add to the author's experience, I spent 18 months of production time with Elixir and Phoenix. As he says, the templates are compiled and are blindingly fast compared to Rails. Pattern matching is really really nice when used in the right places (and you'll miss it if you go back to Ruby); but it can be overused. There's a faction of Elixir folks who attempt to avoid all conditionals and instead seem to prefer mult…