Web applications are unwittingly replacing the old desktop applications. They are more convenient to use, they are easy to update, and they are not bound to one device. And even though users are gently moving from browser-based web applications into the mobile ones, the demand for complex and refined apps is already huge and is still growing. If you are thinking about creating your own application, you’ve probably heard that there are two main design patterns for web apps: multi-page application (MPA) and single-page application (SPA). And of course, both models have their pros and cons.
These types of applications are accessible and avoid the waiting time for the user. Examples are Gmail, Google Maps and Facebook.
The benefits the businesses can perceive using SPA are high speed, adaptable layout, relevant and specific information, and easy to use and better conversions.
All these benefits mean that SPAs make up a top web development trend that will have a massive potential in 2020 and beyond.
Single-page sites help keep the user in one, comfortable web space where content is presented to the user in a simple, easy and workable fashion.
Pros of the Single-Page Application:
- SPA is fast, as most resources (HTML+CSS+Scripts) are only loaded once throughout the lifespan of application. Only data is transmitted back and forth.
- The development is simplified and streamlined. There is no need to write code to render pages on the server. It is much easier to get started because you can usually kick off development from a file file://URI, without using any server at all.
- SPAs are easy to debug with Chrome, as you can monitor network operations, investigate page elements and data associated with it.
- It’s easier to make a mobile application because the developer can reuse the same backend code for web application and native mobile application.
- SPA can cache any local storage effectively. An application sends only one request, store all data, then it can use this data and works even offline.
Cons of the Single-Page Application:
UPDATE 27.09.2017: In her comment, Iris Shaffer correctly pointed out that it can be done on server side as well. Indeed, it is easier today than it used to be.
- It is slow to download because heavy client frameworks are required to be loaded to the client.
- Compared to the “traditional” application, SPA is less secure. Due to Cross-Site Scripting (XSS), it enables attackers to inject client-side scripts into web application by other users.
- In this model, back and forward buttons become dysfunctional.
UPDATE 27.09.2017: Nowadays, it’s not an issue anymore.