Releasing Our Code
Understand the Elixir code release.
Introduction
One way Erlang achieves nine-nines application availability is by having a rock-solid release management system. Elixir makes this system easy to use.
Before we get too far, let’s talk about terminology. A release is a bundle that contains a particular version of our application, its dependencies, its configuration, and any metadata it requires to get running and stay running. A deployment is a way of getting a release into an environment where it can be used.
A hot upgrade is a kind of deployment that allows the release of a currently running application to be changed while that application continues to run. The upgrade happens in place with no user-detectable disruption. In this section, we’ll talk about releases and hot upgrades. We won’t dig too deeply into deployment.
Distillery: the Elixir release manager
Distillery is an Elixir package that makes most release tasks easy. In particular, it can take the complexity that is the source of our project, along with its dependencies, and reduce it down to a single deployable file.
Imagine we were managing the deployment of hundreds of thousands of lines of code into running telephone switches while maintaining all the ongoing connections, providing a full audit trail, and maintaining contractual uptime guarantees. This is very complex. And this was the task the Erlang folks faced, so they created tools that help.
Distillery is a layer of abstraction on top of this complexity. Normally, it manages to hide it, but sometimes the lower levels leak out, and we get to see how it’s made.
This course isn’t going to get that deep. Instead, we just want to give you a feel for the process.
Before we start
In Elixir, we version both the application code and the data it operates on. The two are independent. We might go for a dozen code releases without changing any data structures.
The code version is stored in the project
dictionary in ...