Interactive applications using channels
Up to this point, we've been exploring how to use Phoenix to build traditional web applications, where the server receives a request and returns a response. Requests are isolated from one another, and it is the responsibility of the server to keep the state of the conversation with each client. This has been the way most web applications are built because it allows us to scale them easily. Since each request is stateless, the server can always treat them as a new one, giving us the ability to horizontally scale our applications.
In this section, we'll focus on adding channels to our application, which, as we'll see during this chapter, significantly simplifies the implementation of interactive applications. Instead of the traditional request/response flow we've already described (seen throughout this chapter), when using channels we have a permanent connection between the client and the server, which is only closed when either one exits or crashes....