3 ms·
Every time I think about using Phoenix, I get scared off by warnings about how not knowing BEAM can result in serious problems. I’m not sure if that conclusion
by sickcodebruh 6y ago
Every time I think about using Phoenix, I get scared off by warnings about how not knowing BEAM can result in serious problems. I’m not sure if that conclusion is justified but it’s where I end up every time. It’s odd and unfortunate that Elixir and especially Phoenix seem to have invested heavily in being approachable but the rest of the ecosystem seems to have warning signs posted all over the place.
Is this a fair impression? Or is it possible to run Phoenix in production and gradually learn more about the BEAM, leveling up as you encounter new challenges?
- shijie 6y agoAs a daily user of Elixir since 2016, having come from a Python/Django background, I can assure you that you can know very little about OTP/Beam and still be immensely productive. But once you learn the underlying concepts that gird Elixir, so many solutions that normally require queues/caching/back pressure/state machines/distributive architectures are all possible with Elixir itself. I can say this honestly that Elixir is the most powerful I’ve ever felt as an engineer in any language.
- josevalim 6y agoWe work hard exactly so that you can run Phoenix in production and gradually learn more about the BEAM along the way! One recent example is the built-in dashboard showing all the different data the VM and the framework provide: https://github.com/phoenixframework/phoenix_live_dashboard/ https://github.com/phoenixframework/phoenix_live_dashboard/ - at first it may be daunting but providing a web-based experience to help familiarize with the building blocks is hopefully a good first step. We also added tooltips along the way to provide information about new concepts. The same applies to Elixir: learning all of functional programming, concurrent programming, and distributed programming would definitely be too much to do at once, so we do our best to present these ideas step by step. For what is worth, this is also true for Erlang. It has tools like Observer (which was used as inspiration for the dashboard) and a great deal of learning materials. One last advice is to not drink the cool-aid too much. For example, you will hear people talking about not using databases, about distributed cluster state, etc, and while all of this is feasible, resist the temptation of playing with those things until later, unless the domain you want to use requires explicitly tackling those problems. I hope this helps and have fun!
- theanirudh 6y agoIt's totally possible to run Phoenix in prod. I started learning elixir and am using Phoenix for https://getlounge.app https://getlounge.app. I don't use any of the advanced BEAM features like GenServers etc.
- mercer 6y agoI suppose it depends on how specialized or 'heavy' your needs are. I suspect that for a decent portion of web applications, Phoenix might last you longer than others before you would need to dive into the nitty gritty in either language. In my use case, most of my work is rather straightforward web apps. When using Rails I have occasionally run into issues where I had to tweak things or dive a bit deeper. With Phoenix these same projects would've been fine for a while longer. Of course, when you do need to dive in, perhaps an advantage of Rails/Django/Laravel/etc. is that the ecosystem is larger, so your problem might be solved without having to really figure out more.
- te_chris 6y agoIt's really not that bad to learn, to deploy and to work with. You don't have to go all-in distributed system, shared state etc to get a lot of benefit from Ex and the smart decisions it has made.
- josefrichter 6y agoNo, I don't think that's a fair impression. > not knowing BEAM can result in serious problems No, it can't really. I'd even say that Phoenix largely uses BEAM and its genservers under the hood "so that you don't have to" and still be able to reap their massive benefits. You'd be perfectly fine (and it's not uncommon) writing a production app without writing a single genserver (kinda the cornerstone of BEAM) yourself, and you'd still get a highly performant web app that can handle a ton of concurrent traffic out of the box. Then you can take it from there, deepen your knowledge, and write your own genservers and other BEAM goodies where and when you need them. Phoenix can guide you from the very basics, helping you write apps in simple fashion very much like in Rails, Laravel, Django, etc. It just has a larger range of possibilities on the upper end, letting you build massive high-traffic services, if you need to.