Getting Elixir/Phoenix deploys down was pretty tough (for me and my self-inflicted approach). It's recently become better with Distillery 2.x and I think it will continue to improve with time. Understanding build time env vs runtime env `System.get_env` is unique to Elixir and conflicts with previous experience of how ENV works in other languages. I agree that there's some neat tricks to keep the app running (hot reload) but at the same time I think Elixir should embrace Docker with conventions and examples. I read some people asking why anyone would want to use Docker with a Phoenix app. It kills hot reloading. Yeah, I understand given a vacuum that hot reload in Elixir would be better than Docker but Docker has advantages and adoption at this point. Elixir is just an app, Docker might be driving architecture or automation for use with everything. I've gotten Docker/Elixir/Distillery/ENV to work but it was quite a learning experience and I just happened to be doing it during the Distillery 2.x migration (and other projects being deprecated). What goes in what config? What goes in ENV? What is safe to put in secrets? What config can go in config and the per-environment config? Is this ENV really getting set or is there another default, can I delete this line and watch it break? It's tricky. At the end of it though is something I feel is better than traditional Rails / Capistrano / ssh based deploys. You have lots of safety in Elixir, releases are standalone and it can be dropped into a Docker container which has a content SHA. And then you align with other containers. I guess it depends on your project and team. Given the deploy you showed in the video, yeah, it's overkill. Rails can do zero downtime restarts which end up acting like hot reloading but not quite as natural. Problems like this are pushed somewhere else. Live app deployments can be done within an app server with unicorn and the entire app tier to a load balancer pool. I feel that it's not a great trick and explicit reloading is better. It's a trick but handled like other things at the system level: hot reloading with unicorn, concurrency with sidekiq. It's not exactly that simple though because a load balancer gives you a health check and other benefits. And sidekiq does more than just concurrency (job retries, batches).
@AlchemistCamp
5 жыл бұрын
This is a really useful comment! I may suffer from "the curse of knowledge" at this point in that I don't know what it's like not to be familiar with some things. It sounds like maybe some of the pain was that Elixir *feels* like an interpreted language but unlike Ruby/Python/PHP, everything is compiled, including the configs. Could you elaborate a bit on what problems you hit with the config files? Were you putting your secrets in prod.secret.exs or were you mostly relying on external environment variables?
@AlchemistCamp
5 жыл бұрын
Quick correction for the video, the 2nd time I mentioned reverse proxying I said Node, but I meant Nginx. You can, but don't need to use an Nginx reverse proxy in front of your Phoenix app. I've shipped apps both ways and each have their pluses and minuses!
@victor.ivanov
5 жыл бұрын
It is a bit misleading to say that you don't need Nginx if you are building with Elixir/Phoenix. This combo will not perform just the same as Nginx when we speak about serving static assets. Nginx will do it much more efficiently, using just a small portion of what Phoenix would use in terms or RAM/CPU. But if you are just starting out - it is fine to ignore that difference.
@AlchemistCamp
5 жыл бұрын
@@victor.ivanov For my last startup, I served port 80/443 from Phoenix *because* the performance was better than putting Nginx in front as a proxy! If the entire site were static assets, Nginx might have been slightly faster, but for my use case, performance measurably improved when I removed Nginx.
@pierreaurelemartin3778
4 жыл бұрын
This channel really has great content ;) Thanks !
@andibensisva2155
5 жыл бұрын
thank you
@nikoladjordjevic4477
5 жыл бұрын
When we will get Phoenix 1.4 Part 6 ????
@AlchemistCamp
5 жыл бұрын
Parts 6 and 7 are both already published on alchemist.camp/episodes. They don't show up on the feed since they're premium episodes. There will definitely be more free content here on YT, though!
@nikoladjordjevic4477
5 жыл бұрын
@@AlchemistCamp But how am I supposed to pay when I am broke and I study to earn money xD Dead lock...
@andibensisva2155
5 жыл бұрын
Nikola Djordjevic I hope you will get better oportunity. there are a lot another free elixir lessons in youtube. the official site of elixir and phoenix also provide good enough guide for beginner.
@AlchemistCamp
5 жыл бұрын
@@nikoladjordjevic4477 I've been there. Definitely don't pay now! Keep learning from the free content. There's good stuff at elixirschool.com/en/. You can use my channel for ideas but it's just one resource out of many! Elixir Forum is helpful, too!
Пікірлер: 12