If you want to decide about what technology you want to make your solution, one of the things to consider is if it should be Single Page Applications (SPA) or Multi Page Application (MPA). I see some teams decide to go with SPA because it is shiner, or MVC because they are in the impression that it is easier. But “right tool for the job” at the end of the day makes your life much easier! so lets see when to use SPA and when to use MPA.
SPA vs MPA
SPA pages are faster when you only want to change a specific part of the page. You don’t want your user to wait for the whole page to be loaded. In this case SPA give you a better user experience.
Content of the pages caching
If you have a portal that users log in and interact with it (like a bank portal page), the SPA solution is perfect because it loads once and then user interact with it. In result it updates that part of the page that needs to be updated. If you think about it, it is useless to cache portal pages (as full html page) with changing data of each user, because they are all different and personalized based on users data.
But if you have a blog or web-shop (other than checkout section that is personalized) most of information in each page is the same for everyone (at least of you designed it with correctly) so basically you can cache the most of it as a finished page and serve it much faster and less load on the server, as well as very fast serving resulting a better user experience (more likely user visit another page thus more money)
For SPA pages (back to bank portal example), users come to the portal via specific URL, interact with the UI (transfer some money) and live the portal.
For Blog or Web-shop (other than personalized parts) people are likely come to a random page via search engines or advertisements, read some static information most likely leave or click on a link on your page to visit another page.
For the bank portals like solutions, the amount of information sent and receive is very low but it relay on the backend. On the other hand, for blog like solutions there not much backend jobs but querying the database and serve relevant information to product or post.
Although SPA is shiny, MPA has its own use cases. SPA is best for situations when users logs in and interacts with UI. And MPA is best for cases like blog or web-shop where each page is a specific content and has many visitors.
Leave a Reply