Update cookies preferences

Functional Web Development with Elixir, OTP and Phoenix [Paperback / softback]

4.15/5 (150 ratings by Goodreads)
  • Format: Paperback / softback, 250 pages, height x width x depth: 234x190x11 mm
  • Pub. Date: 19-Apr-2018
  • Publisher: The Pragmatic Programmers
  • ISBN-10: 1680502433
  • ISBN-13: 9781680502435
Other books in subject:
  • Paperback / softback
  • Price: 52,74 €
  • This book is not in stock. Book will arrive in about 2-4 weeks. Please allow another 2 weeks for shipping outside Estonia.
  • Quantity:
  • Add to basket
  • Delivery time 4-6 weeks
  • Add to Wishlist
  • Format: Paperback / softback, 250 pages, height x width x depth: 234x190x11 mm
  • Pub. Date: 19-Apr-2018
  • Publisher: The Pragmatic Programmers
  • ISBN-10: 1680502433
  • ISBN-13: 9781680502435
Other books in subject:

Elixir and Phoenix are generating tremendous excitement as an unbeatable platform for building modern web applications. Make the most of them as you build a stateful web app with Elixir and OTP. Model domain entities without an ORM or a database. Manage server state and keep your code clean with OTP Behaviours. Layer on a Phoenix web interface without coupling it to the business logic. Open doors to powerful new techniques that will get you thinking about web development in fundamentally new ways.

Elixir and OTP give us exceptional tools to build stateful back-end applications that really scale, with rock-solid reliability. In this book, you'll build a web application in ways that are radically different from the norm. The back end will be stateful, not stateless. Use persistent connections with Phoenix Channels instead of HTTP's request-response, and create the full application in distinct, decoupled layers.

In Part 1, start by building the business logic as a separate application, without Phoenix. Model the application domain with Elixir Agents and simple data structures. By keeping state in memory instead of a database, you can reduce latency and simplify your code. Then add OTP Behaviours such as gen_server and gen_fsm that make managing in-memory state a breeze. Create a supervision tree to boost fault tolerance while separating error handling from business logic.

Phoenix is a modern web framework you can layer on top of business logic while keeping the two completely decoupled. In Part 2, you'll do exactly that as you build a web interface with Phoenix. Bring in the application from Part 1 as a dependency to a new Phoenix project. Then use ultra-scalable Phoenix Channels to establish persistent connections between the stateful server and a stateful front-end client.

You're going to love this way of building web apps!

What You Need:

You'll need a computer that can run Elixir version 1.3 or higher and Phoenix 1.2 or higher. Some familiarity with Elixir and Phoenix is recommended.

Acknowledgments ix
Introduction xi
1 Mapping Our Route
1(8)
Lay the Foundation with Elixir
3(1)
Add a Web Interface with Phoenix
4(1)
Functional Web Development
4(1)
The Game of Islands
5(4)
Part I Define the Functional Core in Elixir
2 Model Data and Behavior
9(34)
The Benefits
10(1)
Let's Build It
11(1)
Discover the Entities and Model the Domain
12(14)
Transforming Data
26(10)
Putting the Pieces Together
36(4)
Wrapping Up
40(3)
3 Manage State with a State Machine
43(22)
A Quick Look at State
43(1)
A Bit of History
44(2)
State Machines
46(1)
A Functional State Machine for Islands
47(2)
Working Through the States
49(12)
Wrapping Up
61(4)
Part II Add OTP for Concurrency and Fault Tolerance
4 Wrap It Up in a GenServer
65(32)
A Look at Micro-Services
65(2)
OTP Solutions
67(3)
Getting Started with GenServer
70(6)
Initializing GenServer State
76(2)
Customizing GenServer Behavior
78(14)
Naming GenServer Processes
92(4)
Wrapping Up
96(1)
5 Process Supervision for Recovery
97(34)
Fault Tolerance
97(2)
Linking Processes
99(6)
Introducing the Supervisor Behaviour
105(1)
Supervision Strategies
105(3)
The Child Specification
108(2)
A Supervisor for the Game
110(2)
Starting the Supervision Tree
112(2)
Starting and Stopping Child Processes
114(3)
Putting the Pieces Together
117(2)
Recovering State After a Crash
119(9)
Wrapping Up
128(3)
Part III Add a Web Interface with Phoenix
6 Generate a New Web Interface with Phoenix
131(22)
Frameworks
131(4)
Applications
135(7)
Generate a New Phoenix Application
142(4)
Adding a New Dependency
146(2)
Call the Logic from the Interface
148(4)
Wrapping Up
152(1)
7 Create Persistent Connections with Phoenix Channels
153(38)
The Beauty of Channels
153(1)
The Pieces That Make a Channel
154(2)
Let's Build It
156(4)
Establish a Client Connection
160(3)
Converse Over a Channel
163(6)
Connect the Channel to the Game
169(11)
Phoenix Presence
180(4)
Authorization
184(3)
Wrapping Up
187(2)
A1. Installing System Dependencies
189(1)
Elixir
189(1)
Erlang
189(1)
Phoenix
190(1)
Node.js and NPM
190(1)
Bibliography 191(2)
Index 193
Lance Halvorsen is a member of the Phoenix core team, the author of the Phoenix Guides, and a senior software architect at Le Tote.