As the line between frontend and backend has blurred over the past few years (thanks React), the JAMStack has emerged as a new paradigm for building sites and apps. The stack itself is generally easy to understand, but the ecosystem – tools, plugins, and APIs – isn’t. We’re going to walk through what the JAMStack is, how to categorize tooling, and why modular use case specific APIs are going to continue to grow in popularity.
Javascript, API, and Markup
The JAMStack is an architectural pattern (sort of) for building apps that moves away from the traditional web server model and focuses on serving static files from “the edge” (data centers physically close to your computer). JAM stands for Javascript, API, and Markup:
- Javascript: all code is in JS, for both frontend interactivity and API requests and handling
- API: instead of a monolithic web server, all backend functionality (authentication, users, etc.) is served via APIs
- Markup: your whole site is just a bunch of HTML files served statically
This is like, very different from what most larger apps look like. If you’re accessing a web app like Twitter in your browser, there’s probably a ton of server side logic dictating what you see, how you log in, and everything else that’s custom about your experience. In a JAMStack app, all of that logic would be encapsulated in simple APIs.
These ideas have been around for a while, but the JAMStack concept is definitely having a moment over the past couple of years:
There’s even a JAMStack conference that started in 2018, started by a group of repeat founders from early JAMStack companies (Contentful, Gatsby, etc.) that have continued investing in the ecosystem.
The past few years have been a perfect storm for the kind of apps we’re talking about. Javascript is now the most popular programming language in the world, used by 70% of devs last year and likely more in 2020. GraphQL is used by almost 40% of JS devs, and even Apollo by 25%. Hosting has gotten laughably cheap, and services like Netlify give you automatic deploys, a global CDN, and authentication for free.
As with everything in web development, JAMStack apps vs. traditional web apps isn’t entirely black and white. Even if you hide complex server logic behind easy to use APIs, JAMStack apps need to have a backend somewhere; and caching and serving files from a CDN isn’t exactly a new idea.
Think of JAMStack less as an architecture and more as a philosophy for where application logic should sit and what best practices for serving sites should be. In that vein, keep an eye out for Redwood.js – they’re taking aim at a full framework for JAMStack apps complete with an actual backend.
The JAMStack Ecosystem
The easiest way to understand all of the available tooling out there is to break it down by JAM – Javascript, API, and Markup.
1. J is for Javascript#
It’s a meme that Javascript is the worst, and some teams have been focusing on improving ergonomics by building on top of it. The best known example is Typescript – it’s basically strongly typed Javascript. The ability to define static types means you’ll be able to catch errors before your code runs. Static typing is standard in languages like Java and C++, and Python added pseudo-support last year. Another example of a related JS add-on: Purescript.
