Yolo’s Tech Stack Secret: How Phoenix LiveView Elevates Full Stack Development
Meet Nyoman Abiwinanda, our Software Engineer from Balanced.io Development team at Yolo Group. He is talking about Phoenix LiveView and its advantages in Full Stack Development.
Building a new product is all about delivering value quickly and efficiently. You want to get your product to market or live as fast as possible, test your assumptions, and make improvements along the way.
If you're a seasoned software engineer, you probably already know that the rush to build software quickly can often mean sacrificing reliability. The faster you go, the more likely you will encounter problems. It's a trade-off that's all too common in the world of software development.
But don’t fall for the myth! Development speed and reliability are not a zero-sum game! Unlike CAP theorem, where you must choose between consistency or availability, there is no law in that state; you must choose speed or reliability in building software. It is still indeed possible to achieve a good level of both aspects!
Of course, there are many factors in achieving good reliability in building software and, at the same time, delivering it quickly, but one of the most important and earliest processes is choosing a tech stack. Picking the right tech stack is seriously the key to the success of any software project. It's not just about the code you'll write; it affects the design, scalability, ease of adding new features, and even your hiring process. In short, the tech stack is the lifeline of your product. So, when it comes to delivering a reliable and speedy product, choosing the right tech stack is one of the most essential steps to get right from the get-go.
In the product team I am working with, we don’t have a lot of developers; hence it can be a real challenge when it comes to splitting up the workload between backend and frontend development. It's common for us to wear multiple hats and tackle full-stack development, but keeping up with all the latest and greatest tools and frameworks in both fields is no small feat. That's why it's important for our tech stack to be well-rounded, fast, and user-friendly. We don't want to sacrifice reliability just to get the job done, but we also can't afford to deliver a buggy product to our customers. Thank goodness for Phoenix LiveView! This tech really comes to the rescue and helps us tackle full-stack development with ease.
How does Phoenix LiveView benefit us?
Phoenix LiveView offers a unique approach to web development that combines the power of Elixir and the simplicity of server-side rendering, resulting in a smooth user experience. Throughout my time in Yolo Group using Phoenix LiveView, I could quickly experience the following benefits of using Elixir LiveView.
1. Productivity boost. Phoenix LiveView takes the headache out of web development by cutting down on the amount of code you need to write. This makes the whole process smoother, faster, and more efficient. No more endless hours spent writing complex JavaScript. LiveView's got you covered for real-time updates. And the best part? You get all the perks of Elixir, like IEx, ExUnit, and Ecto, which means you can prototype your app quickly.
2. Out-of-the-box reliability. The fact that LiveView is built on top of the Phoenix framework means that each user request will be handled in a separate process hence there is no risk of the whole application going down because of an error from just one user.
3. Easy to test. LiveView has first-class testing support. With LiveView's test, you can write browser-like tests similar to how you would write them using heavy hitters such as Selenium and ChromeDriver, but without the complexity of bringing a whole browser into the mix. This allows us to test our application from the backend and user perspectives with the upshot of orders of magnitude faster and more reliable than using a browser with a web driver.
4. Fun to work with. One of the best things my team thinks about Elixir and Phoenix LiveView is that they're just plain fun to work with. The syntax is clean and concise, plus with fantastic documentation; it's a breeze to learn and use. This makes the development process more enjoyable and less frustrating. When I joined Yolo, I found that working with a LiveView code base, despite having a very minimal experience with it, is still easier than working with React code base, despite having more experience with it.
But is it always best fit for a project?
As great as Phoenix LiveView may sound, there isn’t any one size fits all technology and Phoenix LiveView is no different. By its fundamental design, it has its limitations and may not always be the best fit for every project. So when should you not consider using Phoenix LiveView?
1. Your application needs complex animations. Now, frameworks such as Phoenix LiveView have been a great help in building a front-end part of a product but it doesn’t make building complex animations easier out of the box. While it has made state management a lot easier in building front-end applications, building a complex animation may require more than just state management and it might as well be closer to mastering CSS and Javascript which in this case due to the huge community or available open source libraries, using React might as well be better for you for the sake of avoiding reinventing the wheel too much.
2. Your application needs offline support. By design Phoenix LiveView is a server-side rendering technology so if you are building an offline-first Progressive Web App or similar applications, you have to write Javascript that could run independently on the client side. If you build such applications, it might be wise to avoid LiveView. Although it's still possible to find a solution that combines LiveView with JavaScript integration where you only implement LiveView for parts that are not meant to be offline, it would require some out-of-the-box thinking and might lead you to a messy design.
Will Phoenix LiveView stay relevant in the long term?
LiveView may be a newcomer to the scene, but it's been making big waves in the Elixir community since its launch in 2019, and companies like Yolo are one out of many companies that have been using it to build products. With benefits like real-time updates, top-notch performance, a streamlined development process, and a simple learning curve, I think there will be more people or companies who will start using it in production in the future. So if you are a startup, a small business, or an established company looking to build a new product, consider Elixir and Phoenix LiveView as your next programming language and framework of choice!