Book Image

Phoenix Web Development

By : Brandon Richey
Book Image

Phoenix Web Development

By: Brandon Richey

Overview of this book

Phoenix is a modern web development framework that is used to build API’s and web applications. It is built on Elixir and runs on Erlang VM which makes it much faster than other options. With Elixir and Phoenix, you build your application the right way, ready to scale and ready for the increasing demands of real-time web applications. This book covers the basics of the Phoenix web framework, showing you how to build a community voting application, and is divided into three parts. In the first part, you will be introduced to Phoenix and Elixir and understand the core terminologies that are used to describe them. You will also learn to build controller pages, store and retrieve data, add users to your app pages and protect your database. In the second section you will be able to reinforce your knowledge of architecting real time applications in phoenix and not only debug these applications but also diagnose issues in them. In the third and final section you will have the complete understanding of deploying and running the phoenix application and should be comfortable to make your first application release By the end of this book, you'll have a strong grasp of all of the core fundamentals of the Phoenix framework, and will have built a full production-ready web application from scratch.
Table of Contents (14 chapters)
4
Introducing User Accounts and Sessions

Introduction to Elixir's concurrency model

We talked a bit at the start about the concurrency and parallelism model at play in your standard Phoenix application but not really a lot about what it actually means. Sure, we get great scaling and performance right out of the box, but what is really going on? Phoenix is built to heavily lean on the BEAM VM's constructs, which allow multiple processes to be spun up at a moment's notice and discarded almost as quickly! The ability to spin up new processes with very low initial cost and toss them away without any repercussions to the rest of the system is a large part of what enables us to create such projects and architectures in Phoenix!

In Elixir, we typically try to divide up related bits of work into their own processes, much in the same way that in an object-oriented language you may try to separate functionality...