Atnaujinkite slapukų nuostatas

Real-time Phoenix: Build Highly Scalable Systems with Channels [Minkštas viršelis]

4.51/5 (76 ratings by Goodreads)
  • Formatas: Paperback / softback, 250 pages, aukštis x plotis x storis: 234x190x19 mm, weight: 622 g
  • Išleidimo metai: 11-Jun-2020
  • Leidėjas: O'Reilly Media
  • ISBN-10: 1680507192
  • ISBN-13: 9781680507195
  • Formatas: Paperback / softback, 250 pages, aukštis x plotis x storis: 234x190x19 mm, weight: 622 g
  • Išleidimo metai: 11-Jun-2020
  • Leidėjas: O'Reilly Media
  • ISBN-10: 1680507192
  • ISBN-13: 9781680507195

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.

Real-time applications come with real challenges - persistent connections, multi-server deployment, and strict performance requirements are just a few. Don't try to solve these challenges by yourself - use a framework that handles them for you. Elixir and Phoenix Channels provide a solid foundation on which to build stable and scalable real-time applications. Build applications that thrive for years to come with the best-practices found in this book.

Understand the magic of real-time communication by inspecting the WebSocket protocol in action. Avoid performance pitfalls early in the development lifecycle with a catalog of common problems and their solutions. Leverage GenStage to build a data pipeline that improves scalability. Break your application before your users do and confidently deploy them. Build a real-world project using solid application design and testing practices that help make future changes a breeze. Create distributed apps that can scale to many users with tools like Phoenix Tracker. Deploy and monitor your application with confidence and reduce outages.

Deliver an exceptional real-time experience to your users, with easy maintenance, reduced operational costs, and maximized performance, using Elixir and Phoenix Channels.

What You Need:

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

Acknowledgments ix
Introduction xi
1 Real-Time is Now
1(14)
The Case for Real-Time Systems
1(2)
The Layers of a Real-Time System
3(3)
Types of Scalability
6(3)
Achieving Real-Time in Elixir
9(1)
Building Real-Time Systems
10(1)
Wrapping Up
10(5)
Part I Powering Real-Time Applications with Phoenix
2 Connect a Simple WebSocket
15(12)
Why WebSockets?
16(1)
Connecting our First WebSocket
17(1)
WebSocket Protocol
18(5)
Long Polling, a Real-Time Alternative
23(2)
WebSockets and Phoenix Channels
25(1)
Wrapping Up
26(1)
3 First Steps with Phoenix Channels
27(26)
What are Phoenix Channels?
28(1)
Understanding Channel Structure
29(8)
PubSub
37(1)
Send and Receive Messages
38(7)
Channel Clients
45(6)
Wrapping Up
51(2)
4 Restrict Socket and Channel Access
53(14)
Why Restrict Access?
53(1)
Add Authentication to Sockets
54(5)
Add Authorization to Channels
59(3)
Use Authentication from JavaScript
62(1)
When to Write a New Socket
63(2)
Wrapping Up
65(2)
5 Dive Deep into Phoenix Channels
67(24)
Design for Unreliable Connections
67(4)
Use Channels in a Cluster
71(3)
Customize Channel Behavior
74(5)
Write Tests
79(10)
Wrapping Up
89(2)
6 Avoid Performance Pitfalls
91(30)
Measure Everything
92(6)
Keep Your Channels Asynchronous
98(3)
Build a Scalable Data Pipeline
101(16)
Wrapping Up
117(4)
Part II Building a Real-Time Application
7 Build a Real-Time Sneaker Store
121(20)
From Product Requirements to a Plan
122(2)
Set Up the Project
124(1)
Render Real-Time HTML with Channels
125(6)
Update a Client with Real-Time Data
131(4)
Run Multiple Servers
135(5)
Wrapping Up
140(1)
8 Break Your Application with Acceptance Tests
141(20)
The Power of Acceptance Testing
142(1)
Break Your App Like a User
143(5)
Break Your App Like a Server
148(5)
Automate Acceptance Tests With Hound
153(7)
Wrapping Up
160(1)
9 Build a Real-Time Shopping Cart
161(30)
Plan Your Shopping Cart
162(3)
Scaffold Your Shopping Cart Channel
165(6)
Build Your Shopping Cart Channel
171(10)
Add Real-Time Out-Of-Stock Alerts
181(5)
Acceptance Test the Shopping Cart
186(4)
Wrapping Up
190(1)
10 Track Connected Carts with Presence
191(30)
Plan Your Admin Dashboard
192(2)
On Track with Phoenix Tracker
194(2)
Use Tracker in an Application
196(5)
Phoenix Tracker Versus Presence
201(1)
Scaffold the Admin Dashboard
202(5)
Track Shopping Carts in Real-Time
207(4)
Assemble the Admin Dashboard
211(3)
Load Test the Admin Dashboard
214(2)
Wrapping Up
216(5)
Part III Bringing Real-Time Applications to Production
11 Deploy Your Application to Production
221(16)
The Lay of the Land
222(3)
Achieve Scalability with Load Balancing
225(3)
Push New Code Safely
228(3)
Cluster Your BEAM Nodes Together
231(2)
Advanced Phoenix Channel Configuration
233(2)
Wrapping Up
235(2)
12 Manage Real-Time Resources
237(20)
Getting Comfortable with Elixir's Scheduler
237(5)
Manage Your Application's Memory Effectively
242(7)
Inspect a Running Application
249(4)
Wrapping Up
253(4)
Part IV Exploring Front-End Technologies
13 Hands-On with Phoenix LiveView
257(18)
Getting Started with LiveView
258(6)
Build a LiveView Product Page
264(6)
Write Tests for a LiveView
270(3)
Wrapping Up
273(2)
14 Single-Page Apps with React
275(16)
Manage Channel State in React
276(1)
Write Channels as Components
277(3)
Hands-On with React
280(7)
React Native Channels
287(1)
Wrapping Up
288(1)
The End of Our Journey
289(2)
Bibliography 291(2)
Index 293
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.