Full Stack Is Back! Elixir & Phoenix LiveView
Full Stack Is Back! Elixir & Phoenix LiveView
As front-end, back-end and hosting technologies have become more complex over time, the concept of a full-stack engineer had faded. Elixir and Phoenix LiveView reverses that trend.
Thank goodness we now have the cloud to make our lives so much easier: Lambda, Step Functions, EC2, Containers, Virtual Network, SQS, SNS, DynamoDB, S3, RDS, Cognito, API Gateway, Kinesis, ELB, ElastiCache, DevOps, Security, IAM, monitoring… and of course it is very easy run and test all of this on your workstation.
Complexity is The Culprit
For even the simplest applications, the starting position for modern applications is frustratingly complex. For several years now, I’ve been amazed watching intelligent professionals in this industry accept and promote this complexity into nearly every single application that we build. It seems like we’ve forgotten about the distinction between essential complexity and accidental complexity. Every application will have some inherent complexity driven by the application domain and the requirements like a responsive UI, data storage and access, etc… The problem is, the accidental complexity of browser side, server side and cloud platform frameworks now dwarfs the essential complexity of even the most basic applications. For those of us who have managed some proficiency in all the technical complexity, we seem to wear the accomplishment like a badge of honor.
As engineers, wouldn’t it be better not to have all of this stuff in the first place?
Less is More: Elixir and Phoenix
Elixir is a modern programming language that lowers the barrier to entry for functional programming. It was designed to be an approachable language for all developers while providing the legendary reliability and scalability of the Erlang runtime. Using an expressive language like Elixir results in less code that is easier to comprehend. This has proven to be a powerful foundation for building modern web applications. Companies like BleacherReport have scaled to millions of users while reducing their cloud footprint by 95% after they migrated to Elixir from Ruby on Rails.
Delivering a responsive web app using Elixir and Phoenix LiveView feels great. Drastically reducing the complexity of the typical web application architecture will be a shock the first time you build a LiveView app. Deploy your app using only one artifact - into the cloud using Gigalixir or Fly.io, and it almost feels like cheating to deliver such rich functionality with so little code.
Recently, I built and deployed a production application for a customer using a stack that was refreshingly simple. It was a small web application that checked all the modern boxes:
- Single Page Application responsiveness
- API integration
- Accessed government per diem reimbursement rates using a public API
- Accessed the customer’s SaaS sales system API for pulling and pushing data
- Utilized a SQL database for data not stored in the SaaS system
- Deployed into the cloud
What To Expect
If you’re a developer who has never used a functional programming language, it can be uncomfortable at first. As Paul Graham pointed out over 20 years ago, “programming languages vary in power”. You may find yourself looking up the power continuum and thinking Elixir is “weird”. It is hard because “programming languages are not just technology, but what programmers think in”. However, the rewards are powerfully satisfying and there’s a reason why developers who use functional programming languages wax rhapsodic about it. Once you get it, you have moved up the power continuum, and you’ll never want to go back.
If you’re a manager wondering about Elixir, take a look at “Ten Companies That Use Elixir in Production”. The stories in this blog post highlight reducing cloud footprint by 95% and delivering world-class apps with small development teams; they are compelling. Also, I encourage managers to read Paul Graham’s essay “Beating the Averages”. This essay is a wake-up call for understanding how a more powerful programming language can enable productivity that is not matched by the “average” corporate IT shop. Just as significantly, it also addresses why developers are resistant to change.
As an experienced developer, my favorite tutorial to date has been Dave Thomas’ “Elixir for Programmers” video course. It is worth it to work through each exercise; he does a great job of guiding you down the path of thinking differently. For a more in-depth course, take a look at the excellent Pragmatic Studio LiveView course.
It’s been a long time since I’ve thought it was fun to build a web application. Elixir and Phoenix LiveView have put the fun back in doing full-stack web development.
Scott can be reached here: