pillaiindu
OK, I created a Phoenix application (after reading numerous books), now how do I deploy it?
Note: Please read the question and details, and think about it before reading any of the replies.
There are numerous resources (books, video tutorials/courses, blog-posts etc) which will teach a complete noob how to create a web application based on Phoenix from start to finish, but there is no single resource which will teach her to deploy that same application (in a way as if it’s taught to a 5 / 6 years old).
I had high hopes from the book Designing Elixir Systems with OTP, but when I read its contents, it doesn’t teach how to actually deploy the SCALABLE application you created after reading that book, and I think nobody designs a SCALABLE application just to keep it in her harddisk and brag about it in front of her friends.
Is there any book which will teach me how to deploy an Elixir / Phoenix application in a way as if Jose or Chris is deploying himself or someone from Plataformatec or DockYard in the best scalable way on a group of bare-metal servers rented at Hetzner or a cluster of VPS instances from DO, Linode (again) Hetzner or other cheap (but reliable) host?
I checked Rails community have some nice books (and some dedicated coruses) on this topic which teaches a noob how to deploy a Rails application to a VPS (with and without Docker/Kubernetes etc) she just created.
Most Liked
lukebakken
My co-worker Gerhard put together the following - The new changelog.com setup for 2019
It goes into great detail about how changelog.com is deployed. The entire deployment code is open-source as well.
idi527
There have been several ElixirConf talks about this which would probably answer most of your questions … I like this one in particular: Tian Chen - Release, Deploy, Monitor and Upgrade Elixir Services in Real World - Code BEAM SF 2018
LostKobrakai
There are two parts to deployment.
- Bundle the data needed to be pushed to your servers
In Elixir/Erlang usually you build an otp release to be deployed. There is documentation formix releasein elixir 1.9 and also quite a bunch of documentation around distillery. In erlang I’m not sure which tool would create the release, but it’s a similar process. - Getting said data to the server and running it on there.
This part is actually hardly specific to elixir/erlang at all, there are a few requirements to releases (same architecture/os/native libraries where the release is build and deployed), but other than that it can be as simple as sftp’ing the release to the server or wrapping it in a docker file and using k8s to move it to the servers it should run on. Starting the release is actually just calling a binary with a command of how you’d like to run the release (daemonized vs in foreground). Those commands are also well documented. - (Extra)
Erlang Clustering: You can find a chapter on how it works in Designing for Scalability with Erlang/OTP. There’s also something in the erlang documentation itself. How you configure clusters depends quite a bit on how you manage servers and how dynamic/static your clusters are/should be.
Mnesia: If you use mnesia the above afaik becomes more tricky as mnesia is said to be not well suited for nodes joining/leaving often.
Other external dependencies to run: Look for “How to deploy external dependency”
I hope the above makes the point clear that when it comes to deployment a good chunk is not really about ruby or elixir or go, but about “do we buy a few bare metal servers and configure everything statically” or “we manage k8s clusters of 1000 nodes”; “Do we use CI/CD or deploy from developer machines?”. I’m not aware of books specifically for elixir (yet), but you should be able to read e.g. a generic “this is how you do CI/CD” book and adapt it to how elixir fit’s into the picture.
Also if you could specify which of the above topics you have most problems with people can also be more precise in suggesting reading material on the topic.
Popular in Questions
Other popular topics
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #websockets
- #supervisor
- #advent-of-code
- #elixirconf-us
- #distillery
- #processes
- #forms
- #api
- #metaprogramming
- #security
- #performance









