AstonJ
March 21, 2017, 4:40pm
1
by Lance Halvorsen
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 provide exceptional tools to build rock-solid back-end applications that scale. In this book, you’ll build a web application in a radically different way, with a back end that holds application state. You’ll use persistent Phoenix Channel connections 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_statem 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!
Don’t forget you can get 35% off the ebook using the code ‘devtalk.com ’
We improve the lives of professional developers. We create timely, practical books on classic and cutting-edge topics to help you learn and practice your craft, and accelerate your career. Come learn with us.
Can’t wait
54 Likes
lance
March 21, 2017, 5:37pm
2
Thanks for the hat-tip! I’m beyond excited for the beta launch.
17 Likes
AstonJ
March 21, 2017, 5:49pm
3
I bet you are Lance, congrats! And thanks for taking the time to write it and all your work on the Phoenix Guides
I can’t wait to get my hands on the book, though it might be a while before I get around to reading it (got 3 or 4 other Elixir books to read first )
1 Like
Take my money! Oh wait, you just did.
6 Likes
AstonJ
March 21, 2017, 7:27pm
5
Don’t forget you can get 25% off with your forum discount - with the code ElixirForum
3 Likes
voger
March 21, 2017, 7:29pm
6
Sale tomorrow. Does it mean we get a better price tomorrow? Should I wait?
2 Likes
AstonJ
March 21, 2017, 7:32pm
7
Sorry, no, it just means it will go on sale tomorrow. I’ll change the title now - tho you can blame PragAndy as I just copied what he said
You should be able to get 25% off with your forum discount tho.
2 Likes
money is leaving my wallet the second I get home.
2 Likes
Oooh, I’d love to work my way through this. Perhaps I’m overlooking something but it doesn’t look like it says how much of the content is currently available?
1 Like
Looks like there are two excerpts that look already to be fairly well done.
1 Like
lance
March 21, 2017, 10:02pm
15
Most of the book is already there! I currently need to complete two chapters, one on state machines and the other on supervisors.
They’ll be following along soon.
4 Likes
AstonJ
March 21, 2017, 11:07pm
16
Sorry about the mix-up with the coupon everyone, it was my fault
You can use the code ElixirForum
to get your 25% off
cc// @voger @jeramyRR @chrisalley
6 Likes
AstonJ:
ElixirForum
I can verify the code works properly. $16 for this book, $10 for the udemy course… it sure isn’t expensive at all to learn Phoenix.
I also want to attest to the high quality of this book. There is a lot of meat on the bone within it’s current 153 page PDF. I especially appreciate the target project being a game and not yet another ToDo list or blog.
6 Likes
Thanks! I just bought it!
2 Likes
Thanks for posting this (and the coupon) it sounds really exciting!
2 Likes
Cool!
Is this based on Phoenix 1.3?
3 Likes
Cool |> done |> start_reading
2 Likes
AstonJ
March 22, 2017, 3:34pm
23
I love the description of this book:
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!
I am sure it’s going to inspire lots of people to try out Elixir
7 Likes
Agreed. This addresses the exact question I’ve been having… “Do I need OTP with a web app? Where does it help?”
I just wish I didn’t miss out on the coupon
2 Likes