DEV Community

Discussion on: What are some pros and cons of Single Page vs Backend Heavy apps?

Collapse
 
ilicmarko profile image
Marko Ilic

There is no default, and it will never be. Simply because SPA is not better than multipage apps, also vise versa. They are two different software approaches and both will live along side each other.

I completely disagree that every app should be a SPA, and I don't like that people are forcing this so much in 2019. In most cases new developers go for SPA because its "cool and new".

Collapse
 
prahladyeri profile image
Prahlad Yeri • Edited

Cool, appreciate your views. I understand that both approaches are unique and different, I was just pointing out the advantages of SPA vis-a-vis backend centric apps. The most prominent advantage is that you are simply being future proof with a REST API backend - you can tear apart your flask/code-igniter and replace it with django/laravel tomorrow with zero impact to your front-end! You can't do that with backend centric app.

Another advantage is less server load. As you move more business logic to the user's browser than your own, your server will be lighter and thus equipped to handle more requests instead of wasting RAM or CPU cycles.

I understand your point that some apps could be non-SPA but I don't get the reasoning for it. Why should you still put up with backend-centric apps when even android browsers have support for ES6 these days?

Collapse
 
ilicmarko profile image
Marko Ilic

About the server load, what you see as an advantage I see as a downside. The average phone price in the US is 200$, can that phone handle a 1000 rows of table manipulation? This is my problem with SPAs the most people don't get the price of JS. Don't get me wrong I am a JS developer, but I specialize on performance. What most people don't get is 500kb of images are not the same as 500kb of JS.

And the most common problem is SEO and analytics tracking. I implemented all the possible solution that exist by this days and either they make my team want to kill themselves because of the development complexities or they can bring same results as MPA.

Note: I don't hate SPA, on the contrary we use them but for a specific case where it makes sense like dashboards or apps like github. There is no advantage of using a SPA for a presentation, company or in most cases Saas sites

Thread Thread
 
prahladyeri profile image
Prahlad Yeri

The average phone price in the US is 200$, can that phone handle a 1000 rows of table manipulation?

Totally get your point! The way I envisage things, the manipulation of rows will still happen on the backend itself through SQL queries (or nosql equivalent in case of mongodb, etc.). Where front-end can play a part is things like url routing and DOM rendering. Right now, these roles are also played by backend with frameworks like flask/laravel and template engines like jinja2/twig. Aren't you better off by moving all that logic to the client browser instead?