What is the JAMStack?
The JAMstack is a modern web architecture that stands for JavaScript, APIs, and Markup. It is based on the idea of pre-building the entire frontend of a web application and delivering it as a set of static files, rather than dynamically generating pages on the fly using a server-side language or framework.
One of the main benefits of the JAMstack is that it allows for faster and more scalable web applications, since the static files can be served from a content delivery network (CDN) and do not require any server-side processing. This means that the application can handle a large number of requests without the need for expensive server resources.
In comparison with other web architectures, the JAMstack is generally simpler and more lightweight. Traditional architectures, such as the three-tier architecture and the model-view-controller (MVC) architecture, rely on a server to handle requests and generate dynamic content, which can be more complex to set up and maintain. The JAMstack, on the other hand, uses client-side JavaScript and APIs to handle dynamic functionality, which can be easier to develop and deploy.
Benefits of the JAMStack
- Performance: The biggest impact of migrating to JAMStack is performance. Because JAMStack sites are pre-rendered (instead of served to users on request), you get super high performance without expensive infrastructure.
- Security: Unlike older platforms where the hosting, database and code is coupled together, JAMStack sites are seperated. This means less moving parts and serving read-only assets, making it very difficult to hack.
- Scaling: JAMStack sites come automatically with smart caching of pages and resources, serving up everything from a CDN. Continuous deployments come by default with built-in redundancy and have incredible load capacity.
- Portability: JAMStack sites are rendered during build time. This means all you need to host a JAMStack site is a static hosting service that can run a simple build command. We use Vercel, but you're not locked in to any infrastructure.
- Maintainability: Because JAMStack sites have almost no hosting complexity and all the hard work was done during the build stage, there's no need for complex hosting maintenance or a team of support engineers to keep an eye on it.
- Developer Experience: JAMStack sites use JavaScript and some of the hottest frameworks and libraries available (React, Next, Gatsby). The bustling and supportive code ecosystems means your developers will have a much better time.
Our stack of choice
Every JAMStack setup has three key components: a CMS, framework and hosting. Here are our preferred ones.
Headless CMS
Our preferred content management systems are Prismic and GraphCMS. They both offer GraphQL and Rest APIs for us to use, as well as reliable content modelling, repeaters and an approachable pricing model.
Framework
Our JavaScript frameworks of choice are Next.js and Gatsby which handle rendering, bundling, routing and more. We combine this with TypeScript for reliability and Storybook for documenting the design system.
Hosting
Our favourite hosting providers are Vercel and Netlify. They both offer a global edge network to put you as close as possible to your customers, as well as free SSL encryption, asset compression and cache invalidation.
Overall, the JAMstack is a modern and efficient approach to building web applications that is well-suited for applications that do not require a lot of server-side processing or dynamic content generation. It is particularly well-suited for small to medium-sized applications, but can also be used for larger applications with the right design and planning.