To start, JAMstack is a software architecture and philosophy that adheres to the following components: Javascript, APIs and Markup. If this sounds familiar, itâs because it is! That React app that you compile down with Webpack and ultimately serve from S3? Yup, thatâs a JAMstack app. That simple HTML file that has no JavaScript and literally doesnât do anything dynamic? Yup, thatâs also a JAMstack app.
Thatâs not to be confused with serverless: If youâre coming more from the cloud side of things (think AWS, GCP, Azure), you might be inclined to think of serverless and JAMstack as the same thing. Granted they have similarities in the philosophy of how resources are managed, such as hosting a site on S3. But a JAMstack app is not always going to be a serverless app. Consider an app hosted in static storage on the cloud provider of your choice. Yes, you might be serving the app in a serverless way, but you might be dealing with an API that utilizes WordPress or Rails, both of which are certainly not serverless. Combining these philosophies can go a long way, but they shouldnât be confused as the same.
What makes up the JAMstack? Back to the JAMstack: itâs typically comprised of 3 components: Javascript, APIs, and Markup. Its history stems from growing the term âstatic siteâ into something more meaningful (and marketable). So while ultimately a static site is the end result, itâs blown up to include first class tooling for every step of the way. While there arenât any specific set of tools that you need to use, or any tools at all beyond simple HTML, there are great examples of what can make up each part of the stack. Letâs dive in a little bit to each component.
One note about âhostingâ: Using the term hosting here can be misleading if youâre new to the concept. Yeah, your site is technically getting hosted somewhere, but itâs not in the traditional sense. You donât have a server that youâre maintaining where you upload your files to with an FTP client like Cyberduck. Instead, whether your doing it yourself with S3 or piping it into Netlify (which is actually multi-cloud), your HTML and static assets are getting served from object storage. On the tail end of that you typically have a CDN like Cloudflare which caches those files at locations all over the world making your pages load faster for the people visiting your site.
So what makes a JAMstack app so great? JAMstack apps inherently satisfy most if not all of the 5 pillars of the AWS Well-Architected Framework. These are core concepts that AWS considers to deliver fast, secure, high-performing, resilient, and efficient infrastructure.
Is my website considered to be on the JAMstack? We already talked about the 3 components (Javascript, APIs, Markup), but what we didnât talk about is the fact that you donât necessarily have to use all 3 of them in order to consider your site worthy of the JAM label. Really it all boils down to the Markup and how you serve it. Instead of your Rails app rendering your HTML for you, you might host a precompiled React app on S3 that reaches out to Rails via a set of APIs. But you donât even need to have APIs. You donât even need to have Javascript! As long as youâre serving an HTML file without it having to be compiled on a server at request time (aka pre-rendering it), youâve got yourself a JAMstack site. â courtesy