small medium large xlarge

Real-Time Phoenix: Build Highly Scalable Systems with Channels

by

Cover image for Real-Time Phoenix

Real-Time Phoenix

Build Highly Scalable Systems with Channels

by

Give users the real-time experience they expect, by using Elixir and Phoenix Channels to build applications that instantly react to changes and reflect the application’s true state. Learn how Elixir and Phoenix make it easy and enjoyable to create real-time applications that scale to a large number of users. Apply system design and development best practices to create applications that are easy to maintain. Gain confidence by learning how to break your applications before your users do. Deploy applications with minimized resource use and maximized performance.

Customer Reviews

Real-Time Phoenix is hands down the best book to showcase the power of Phoenix
and Elixir. The example application is exciting to build and explore. Steve is the
perfect guide while sharing his hard won knowledge to help you make informed
decisions about your next project.

- Amos King

Founder, Binary Noggin and Elixir Outlaws

In Real-Time Phoenix, Steve covers what you need to know to build a real-time
web application. What sets it apart however is a truly practical approach that
goes beyond simply covering Phoenix Channels, and explains building systems
with the BEAM virtual machine, testing, deployments, and figuring out all kinds
of performance issues or other problems you’ll inevitably encounter. This isn’t
just a getting started book, but a way to get compressed experience without having
to make all the mistakes on your own.

- Fred Hebert

Senior Platform Developer, Postmates

Real-Time Phoenix tackles one of the killer features of Phoenix head on. Starting
with a WebSocket, Steve clearly and convincingly explains why Phoenix Channels
is the right technology for real-time applications. At the conclusion of the book,
you’ll have the tools you need to build your own real-time applications using
Phoenix Channels. If you need real-time interactions in your app—and who
doesn’t?—do yourself a favor and get Real-Time Phoenix.

- Ben Marx

Principal Software Engineer, Co-Author of "Adopting Elixir"

You’re not going to find a more comprehensive guide on the real-time features of
Phoenix and how to use them. This book doesn’t shy away from the practical aspects
of a real web application, from managing clients and setting up data
pipelines, to various strategies for updating the UI and handling your service in
production.

- Johanna Larsson

Software Engineer, Castle

Real-Time Phoenix is my new go-to guide for bringing real-time features to customers.

- Grant Powell

Senior Software Engineer, SalesLoft

As someone who is new to Phoenix, Real-Time Phoenix does a superb job of explaining
the tools the framework provides that can supercharge your web application.
Topics of Channels, PubSub, and Tracker will show new and experienced
developers how to leverage WebSockets to power soft real-time features in easy
ways. I cannot recommend this book enough for anyone who is interested in
Phoenix.

- John Oxford

Senior Software Engineer, PowerSecure

See All Reviews

Choose Your Format(s)

  • $24.95 In Stock
  • Ebooks are DRM free.

  • Ebook delivery options.

What You Need

You’ll need Elixir 1.9+ and Erlang/OTP 22+ installed on a Mac OS X, Linux, or Windows machine.

Contents & Extracts

Introduction

  • Powering Real-Time Applications with Phoenix
    • Connect a Simple WebSocket excerpt
      • Why WebSockets?
      • Connecting our First WebSocket
      • WebSocket Protocol
      • Long Polling, a Real-Time Alternative
      • WebSockets and Phoenix Channels
      • Wrapping Up
    • First Steps with Phoenix Channels
      • What are Phoenix Channels?
      • Understanding Channel Structure
      • PubSub
      • Send and Receive Messages
      • Channel Clients
      • Wrapping Up
    • Restrict Socket and Channel Access
      • Why Restrict Access?
      • Add Authentication to Sockets
      • Add Authorization to Channels
      • Use Authentication from JavaScript
      • When to Write a New Socket
      • Wrapping Up
    • Dive Deep into Phoenix Channels
      • Design for Unreliable Connections
      • Use Channels in a Cluster excerpt
      • Customize Channel Behavior
      • Write Tests
      • Wrapping Up
    • Avoid Performance Pitfalls
      • Measure Everything
      • Keep Your Channels Asynchronous
      • Build a Scalable Data Pipeline
      • Wrapping Up
  • Building a Real-Time Application
    • Build a Real-Time Sneaker Store
      • From Product Requirements to a Plan
      • Set Up the Project
      • Render Real-Time HTML with Channels excerpt
      • Update a Client with Real-Time Data
      • Run Multiple Servers
      • Wrapping Up
    • Break Your Application with Acceptance Tests
      • The Power of Acceptance Testing
      • Break Your App Like a User
      • Break Your App Like a Server
      • Automate Acceptance Tests With Hound
      • Wrapping Up
    • Build a Real-Time Shopping Cart
      • Plan Your Shopping Cart
      • Scaffold Your Shopping Cart Channel
      • Build Your Shopping Cart Channel
      • Add Real-Time Out-Of-Stock Alerts
      • Acceptance Test the Shopping Cart
      • Wrapping Up
    • Track Connected Carts with Presence
      • Plan Your Admin Dashboard
      • On Track with Phoenix Tracker
      • Use Tracker in an Application
      • Phoenix Tracker Versus Presence
      • Scaffold the Admin Dashboard
      • Track Shopping Carts in Real-Time
      • Assemble the Admin Dashboard
      • Load Test the Admin Dashboard
      • Wrapping Up
  • Bringing Real-Time Applications to Production
    • Deploy Your Application to Production
      • The Lay of the Land
      • Achieve Scalability with Load Balancing
      • Push New Code Safely
      • Cluster Your BEAM Nodes Together
      • Advanced Phoenix Channel Configuration
      • Wrapping Up
    • Manage Real-Time Resources
      • Getting Comfortable with Elixir’s Scheduler
      • Manage Your Application’s Memory Effectively
      • Inspect a Running Application
      • Wrapping Up
  • Exploring Front-End Technologies
    • Hands-On with Phoenix LiveView
      • Getting Started with LiveView
      • Build a LiveView Product Page
      • Write Tests for a LiveView
      • Wrapping Up
    • Single-Page Apps with React
      • Manage Channel State in React
      • Write Channels as Components
      • Hands-On with React
      • React Native Channels
      • Wrapping Up
      • The End of Our Journey

Author

Steve Bussey is a software architect at SalesLoft focused on delivering the best experience possible for sales people and also his fellow engineers. He has written and led development on real-time Elixir applications that power critical features of business software. He is passionate about sharing Elixir due to the positive impact it has had on how he designs and writes applications.