Normally, when we work on web applications, they are always hosted on some server that contains the front-end and back-end code for that application. A traditional web application is heavily reliant on server-side processing. Whenever a user requests, the server generates the HTML and processes the data accordingly before sending a fully rendered page to the client.
Jamstack stand for Javascript, API, and markup. These web apps differ from traditional web applications in terms of architecture and the approach taken to build them. Jamstack applications focus on a decoupled architecture to separate the frontend and backend, making them highly scalable. There are three main components to a Jamstack application. In this Answer, we will discuss each one of them in detail.
The Javascript part of Jamstack refers to the client-side that is needed to make the website interactive for the user. Like any modern web application, Javascript is essential to make the website dynamic. In jamstack, Javascript is often used to fetch data from APIs using the etch API, manipulate the
The APIs retrieve data and perform various tasks. In a Jamstack application, we can use either third-party APIs or custom-made ones that can provide us with data and services. Jamstack applications rely on APIs to retrieve data and perform various operations. APIs also enable decoupling by helping us to separate the frontend from the backend.
Markup refers to HTML, CSS, and other static assets used to create the presentation layer of the web application. In a Jamstack architecture, these assets are prebuilt during the deployment and served to the user via a
The Jamstack web application architecture has the following advantages:
Decoupling: Jamstack applications allow us to decouple the frontend and the backend of our application because the frontend is made with Javascript and APIs, and the markup can be hosted on a CDN.
Microservice architecture: The back-end services can be divided into many microservices made using their own separate APIs, which means they can be developed independently to allow for more flexibility.
Client-side rendering: The frontend relies on client-side rendering by making requests to the API from the browser and rendering the content dynamically, allowing for a smoother user experience.
Speed: Jamstack applications are known for their speed because they are fast, and almost all the content is prerendered and hosted on a CDN.
Scalability: Jamstack applications are scalable because we can add more CDNs or use serverless functions to handle back-end tasks, which makes it much more suitable for traffic spikes.
Jamstack | Traditional Web Apps |
They rely on client-side rendering to display the requested user page. | They rely on server-side processing to display the requested user page. |
The frontend and the backend are kept separate from one another, allowing for decoupled architecture. | The frontend and backend are tightly integrated into a single codebase, making it monolithic. |
Most of the content is already prebuilt and cached on a CDN improving their performance. | Because the server does most of the processing, these applications put a heavy load on the servers. |
Jamstack applications are highly scalable as they rely on a microservice-based architecture. | Scaling traditional web apps requires adding more server resource which is costly. |
Some popular examples of websites that use the Jamstack architecture are E-commerce websites such as Shopify, documentation sites such as Vue.Js and AlpineJS, and community forum sites such as Forem (DEV.to). These websites leverage the advantages of the Jamstack architecture to make their websites fast, scalable, and highly available.
To conclude, Jamstack applications outperform traditional web applications but are restricted by the fact that they do not rely on servers. This makes them complex to build, and they are not often suitable for complex applications that require real-time data updates and server processing. Applications such as social media platforms and E-commerce websites are not suitable to be built on the Jamstack architecture. However, if we want to build a content-focused website where static content can be prebuilt and served quickly, then we can rely on the Jamstack architecture.
Free Resources