CMS001: Jamstack
Context
Jamstack is an architecture designed to make the web faster, more secure, and easier to scale. It builds on many of the tools and workflows which developers love, and which bring maximum productivity.
The core principles of pre-rendering, and decoupling, enable sites and applications to be delivered with greater confidence and resilience than ever before.
Decision
A Jamstack architecture can bring all sorts of benefits to the sites and to project workflows. The key benefits are related to speed, performance and user experience. We've broken them down further below:
Security
The Jamstack removes multiple moving parts and systems from the hosting infrastructure resulting in fewer servers and systems to harden against attack.
Serving pages and assets as pre-generated files allows read-only hosting reducing attack vectors even further. Meanwhile dynamic tools and services can be provided by vendors with teams dedicated to securing their specific systems and providing high levels of service.
Scale
Popular architectures deal with heavy traffic loads by adding logic to cache popular views and resources. The Jamstack provides this by default. When sites can be served entirely from a CDN there is no complex logic or workflow to determine what assets can be cached and when.
With Jamstack sites everything can be cached in a content delivery network. With simpler deployments, built-in redundancy and incredible load capacity.
Performance
Page loading speeds have an impact on user experience and conversion. Jamstack sites remove the need to generate page views on a server at request time by instead generating pages ahead of time during a build.
With all the pages are already available on a CDN close to the user and ready to serve, very high performance is possible without introducing expensive or complex infrastructure.
Maintainability
When hosting complexity is reduced, so are maintenance tasks. A pre-generated site, being served directly from a simple host or directly from a CDN does not need a team of experts to "keep the lights on".
The work was done during the build, so now the generated site is stable and can be hosted without servers which might require patching, updating and maintain.
Portability
Jamstack sites are pre-generated. That means that you can host them from a wide variety of hosting services and have greater ability to move them to your preferred host. Any simple static hosting solution should be able to serve a Jamstack site.
Bye-bye infrastructure lock-in.
Developer Experience
Jamstack sites can be built with a wide variety of tools. They do not depend on the proprietary technologies or exotic and little known frameworks. Instead, they build on widely available tools and conventions. As a result, it's not hard to find enthusiastic and talented developers who have the right skills to build with the Jamstack. Efficiency and effectiveness can prosper.
SEO Efficiency
Jamstack helps you rank higher because of static pages, which are fast, light, and easy to scan by search engine crawlers.
Google rewards these things with higher positions in search results, and that means you are becoming more competitive, and getting more people that are actually searching for you.
Consequences
The idea behind the Jamstack is appealing: pre-rendered static pages which can be pushed to a CDN and globally available in seconds. Static content is fast, resilient to downtime, and immediately indexed by crawlers. But there are some issues.
If you’ve adopted the Jamstack architecture while building a large-scale static site, you might be stuck waiting hours for your site to build. If you double the number of pages, the build time also doubles. For large web applications, choosing complete static-site generation is a non-starter. Large-scale teams need a more flexible, personalized, hybrid solution.
However, due to Incremental Static Regeneration (ISR) we are able to use static-generation on a per-page basis, without needing to rebuild the entire site. With ISR, we can retain the benefits of static while scaling to millions of pages. This means we have very little consequences by chosing this architecture.
Summary
We have decided to use this architecture for our content driven pages as Jamstack has become the standard architecture for web. Luckily our React Framework allows us to use Incremental Static Regeneration (ISR) which is a new evolution of the Jamstack, allowing us to update static content instantly without needing a full rebuild.