Single Page Application vs Multi Page Application (SPA vs MPA)
In the era of cloud , every application has been / being migrated from desktop to web server. And companies earlier having their older softwares on systems are creating the same as web app for easy and global approach of clients. Now the webapp could be categorized into two types – One is traditional Multi Page Application and the other one is the latest and new approach as Single Page Application.What are SPA or MPA? Let’s figure out.
SPA (Single Page Application):
The latset approach towards creating the web app is Single Page application where all of the content from the server is rendered on single page html. It means:
- The routing is maintained on client side through Java Script
- Devlopement is easy and no need to learn different templating language for a front end devloper to develop the web pages like PHP, JSP or django templating
- Required data on page is served through JSON API from server not using context variables
- Switching into multiple URLs in the web page is easier and faster since routing is on clinet side
- Since all static content like CSS/JS has been loaded initially so redundancy of static variables minimizes the server load
- Using the same API the mobile application can be simultaneously build reducing the load of back end devloper.In this way a back end devloper can concentrate over business logic and code optimzation instead working on page rendering stuff of fron end.
- The devlopement would be fast as the front end and mobile developer can build their application using dummy api’s and later integrating them.
Example of SPAs : gmail, Facebook, Twitter
Multi Page Application(MPA)
The web app consists of multiple pages and all of these are rendered on server side.
- Rourting is maintained on server side
- Web app speed is slow as each routing requires a call towards server whihc may take additional round trip towrads server.
- SEO is better managed in MPA
- Backend devloper need to create mobile APIs to give JSON data to mobile devlopers(redundancy of logic).
- Tightly coupled front end /backend
As per the given approach it seems to be use SPA for a better user experience and fast devlopment process.
However the SPA also having their own cons. At the end the approch completely depends upon what is the business need.
So take a call and analyze which should be best for you..