As web development grew up rapidly in the last few years, creating a website now takes different approach than the past.
Nowadays there are two ways to develop a website:
Single Page Application
Multi Page Application
Singe Page Application or
SPA is serving a website from one single page, this means you don't go backward and forward between pages like normal
multi page applications.
The very interesting advantage of
SPA is all assets like
JS are loaded only once during the application surfing, only the data are transmitted back and forth with backend using
- Decouples frontend from backend.
- Doesn't reload the page when navigating to a link inside the website.
- The website is blazing fast than the
Multi Page Applicationas all assets like
JSare loaded only once.
- Easier to develop and deploy as you may run it without a server.
- Easier to debug.
- As backend code is separated from frontend, we can easily use same backend API for mobile applications.
- Faster in deploying as frontend and backend developers work in parallel.
- Not playing well with SEO, you need to use an SSR
- Dependence on JS as JS is the
main keyto render the HTML elements to the DOM.
- Frontend frameworks have a learning curve to work with.
- Less secure: it has a less security compared to
MPAbecause of Cross-Site Scripting
- Higher in cost as you higher more people to the team
Multi Page Application
MPA is the standard way to develop websites which most of the websites are using so far.
When navigating to another page inside the website it does
reload the page.
- Playing very weill with SEO search engines.
- Has a better security.
- Usually lower in the cost than
- Harder to maintain and debug.
- Harder for updates.
- Requires a reload for each page.
- Frontend and Backend are tightly coupled.
- Slower than
SPAas you load the entire
HTMLcode each time you open the website.
Well, there is no direct or
one answer for that question but here are some keys to use as a criteria of selection:
- Is it a public website or an internal system?
- How much budget do you have?
- The time of website deployment, how much time it should take?
- What is the scale of the website?
- How many functions and features should be in the website?
- Does it really mater about SEO?
I hope this post illustrated the main differences between