TL;DR
While JAMstack hasn’t yet become the new standard, nor is it certain it will, the general trend is here to stay – removing the complexity of web apps where it’s not needed. This stack can provide many benefits including excellent performance, scalability, and security. It can be already applied to many businesses. Static HTML pages can be mixed with a client-side rendering for the bits of your pages that require highly dynamic or personalized content.
First things first, what is JAMstack? Is it just another buzzword or the future of web development?
JAM is the acronym for “JavaScript, APIs, Markup”, which corresponds to the three critical components of a site in JAMstack:
[J] JavaScript code for the dynamic aspect - Any dynamic programming that is running a request/response cycle on the client side should be handled by JavaScript. This can include any JS framework like Vue, React, or Angular.
[A] APIs - Server-side operations are abstracted into reusable APIs and accessed over HTTPS. These can be third-party services or your custom function.
[M] Static HTML pages (”Markup”) - these can be generated from source files, such as Markdown, using Static Site Generators, such as Hugo, Gatsby, and 11ty.
Do we really need JAMstack?
It is a modern and revolutionary web development architecture, which makes the applications be built faster and deployed with ease in a couple of minutes. It is ideal for businesses that want a fast, secure, and scalable website.
Over the past years, this concept grew out of its original acronym, and now it’s more than just another technology stack. If we check their official website, it is “an architectural approach that decouples the web experience layer from data and business logic.” The microservice architecture is a key element of JAMstack. Notice the word ‘decouples’ in the description above. The other key element is automation, especially the one during the build and deployment of the website. Every time some part of the website content is updated, a webhook is fired, which triggers the build and the updated markup is deployed. Without this key element, we would need to manually edit the HTML of the page to replace a logo or the title of a product.
How does JAMstack help me when building the website?
We don’t need to worry about server uptime, deployment and scaling, caching, cache invalidation, security, and all the other issues that come with having a web server processing requests, a JAMstack website pre-renders the markup (HTML) of the website at build time using a Static Site Generator, and serves it as static assets on a CDN.
What to do regarding the dynamic content when using JAMstack?
Not everything on the website can be static and pre-baked at build time. Client-side rendering can be used for the bits of your pages that require highly dynamic or personalized content. This is usually done by packaging a specific part of your business logic into a separate API. This can take many forms – a custom microservice, a serverless function, or a 3rd-party API of a SaaS solution.
Lastly
JAMstack has a strong focus on the web developer workflow and the website lifecycle. It is an approach to building and delivering websites, not just architecture. It isn’t a completely new concept, but rather a new name for a combination of established practices that go well together. Doing more work at build time rather than runtime, microservices rather than a monolith, Git-based workflow, and CI/CD automation – these are well-known patterns in software development.