Phoenix LiveView is an innovative library for the Phoenix Web Framework that enables rich, highly interactive, UI experiences for web applications. In this article I’ll explain why LiveView is an ideal fit for environments with limited bandwidth, compute capacity, and latency.
Let’s begin by reviewing the components of a very common web app architecture today:
However, like anything, there are some trade-offs that come with SPAs. Data-intensive applications will often require many HTTP requests to the API. This is especially apparent with novel representations (such as graph-based) that split the data required to assemble a coherent model across many API resources or query results. Other API technologies, such as GraphQL, try to solve these problems (sometimes known as overfetching or underfetching) by providing a more sophisticated query language for API resources. However, the data still needs to be sent over the wire.
These problems become especially apparent in the difficult environments that some users, such as many in the defense community, operate in. Take the following example scenario:
Most SPAs will struggle to maintain a good user experience in this environment:
So, what’s the solution? We could move back to server side frameworks such as Rails, but wouldn’t it be nice if we could keep all of the benefits of the SPA architecture while addressing the problems above?
All of these qualities make LiveView ideal for applications that need advanced interactivity and real-time capabilities and have users in resource constrained and unreliable environments.