Reliable

As Chris followed José into the Elixir community, he learned to appreciate the frameworks that Erlang programmers have used to make the most reliable applications in the world. Before Elixir, the language of linked and supervised processes wasn’t part of his vocabulary. After spending some time with Elixir, he found the missing pieces he’d been seeking.

You see, you might have interactive applications built from beautiful, concurrent, responsive code, but it doesn’t matter unless your code is reliable. Erlang applications have always been more reliable than others in the industry. The secret is the process linking structure and the process communication, which allow effective supervision. You can start concurrent tasks and services that are fully supervised. When one crashes, Elixir can restart it in the last known good state, along with any tainted related service. Erlang’s supervisors can have supervisors too, so your whole application will have a tree of supervisors.

The nice thing is that you won’t have to write that supervision code yourself. By default, Phoenix has set up most of the supervision structure for you. For example, if you want to talk to the database, you need to keep a pool of database connections, and Phoenix provides one out of the box. As you’ll see later on, we can monitor and introspect this pool. It’s straightforward to study bottlenecks and even emulate failures by crashing database connections on purpose, only to see supervisors establishing new connections in their place. As a programmer, these abstractions will give you the freedom of a carpenter building on a fresh clean slab, but your foundation solves many of your hardest problems before you even start. As an administrator, you’ll thank us every day of the week because of the support calls that don’t come in.

In the next chapter, you’ll dive right in. From the beginning, you’ll build a quick application, and we’ll walk you through each layer of Phoenix. The water is fine. Come on in!

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.191.254.44