With the single page application architecture hitting full stride in 2019, it seems like a given that this has become the defacto standard for any new project. The message seems to be that to build anything of value, you need to be building a microservices backend and a single page application frontend.
But have we lost our way? Just because we now can accomplish impressive architectures that enable the entire experience to be loaded in a single request, have we considered if we should?
Everything has tradeoffs
Every choice that you make as a developer solves problems, but also creates problems. One of your primary responsibilities as a developer is to make sure that the ledger of these choices end up solving more important problems then they create.
We tend to look at the advancement of the web as leaving things behind, but I’d assert that it should be seen as progressive enhancement.
This is how I like to frame the conversation around single page applications today. We are viewing server-side rendered solutions as if they are archaic and irrelevant, even though in many cases the added complexity involved in producing a single page application brings no measurable value to users.
That is not to say that this new and exciting way of building applications doesn’t solve problems, becauese it does! You just have to be sure that you actually have the problems it solves.
An alternative, Multi App Pages
We decided that we expressly did not have the problems that single page applications are best at solving. We don’t have a need for microservices. Our frontend would talk to a single backend. We are a 1 person team with production experience building product with Ruby on Rails.
We developed a process that allows us to drop into a proper front end application workflow when interactivity is needed, but allow Ruby on Rails to continue leveraging it’s strengths to build out the bedrock of our application. In this way, on any given route rendered by Ruby on Rails, there may be multiple “frontend applications” that are loaded, from a small simple form element scaling up to an entire interactive dashboard like our project overview.
I can confidently say that this approach has allowed us to move extremely fast in building out our application, without compromising the level of interactivity we need to solve our user’s problems.