Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Guru5005's avatar

SPA Vs Multi Page Application

How can i decide between SPA Vs Multi page application ? Which would be better choice for my application ? I know it is totally depends on my type of application, but still i have a doubt regarding performance like page loading? which would be faster ? html or js ? i am already using SPA (We have created our web services (back end)), some times Components loading is very slow due to huge data i have in my data base (Even though i am using pagination). Will it be better to use Multiple page application if i am processing lakhs of db rows?

Any Assistance would be appreciated.

0 likes
6 replies
rameezisrar's avatar

You can have the best of both the worlds. You can go with blade template and you can add Vue components on the blade templates wherever you think will do the best as per user experience

2 likes
steve_laracasts's avatar

Hey @techguru I don't understand why a design choice on the front end would affect performance on the back end in the way you describe.

If you are using pagination then surely your db queries are returning a limited set of results for each page view?

If you are returning all the records for each request and then doing the pagination after this then I would definitely look into refactoring this so your database query is just returning a few records at a time or something.

There's 2 things to look for in the docs, one GroupBy is not efficient, and the second is Simple Pagination;

https://laravel.com/docs/5.8/pagination

Hope this helps!

1 like
Guru5005's avatar

@KEL_ - @kel_ the data i am getting from query is again being manipulated and returned so i cant even use pagination at some instances, thats a whole different story, what i am concerned is that some times SPA are not feasible to use (From some forums i have read ) , so just wanted to clarify the doubt

mushood's avatar

SPA are not for best SEO wise. If it is a client facing, I would suggest a Multi page application and add vue components like @rameezisrar mentioned.

However, if only used by admin, totally go for SPA. The user XP is most of the time superior. If you have huge data. Limit the number of results of your queries. Once this is loaded, fetch the next batch. Custom pagination if necessary.

2 likes
floxn's avatar

There are a few scenarios where I would prefer SPA over a server side app:

  • if you plan to go multi-platform. In this case you need an API anyway and the SPA is just another client.
  • if you need a desktop-like experience in your app (fast, interactive, offline functionality,..)
  • when developing in teams, I had good experiences with SPAs using separate code bases for back-end and front-end. Clean interface, clear responsibilities.

In almost every other case I would prefer a server side app. An SPA needs additional work to some extend. Thus, there should be a good reason for you, if you go that path.

1 like
YeZawHein's avatar

@mushood If you want SEO friendly , try Universal app (Nuxt.js).

Server side rendering + Single Page Application = Universal app

Just feel it Bboom Bboom!

1 like

Please or to participate in this conversation.