DEV Community


Posted on

What makes a site JAMstack?

You may notice that the JAMstack isn’t really a new concept. Developers have been building static sites that leaned on JavaScript for decades. So what differentiates a JAMstack site from a traditional static one? For starters, the JAMstack is a methodology rather than an outcome. You could say that a JAMstack site is a static site but a static site is not necessarily a JAMstack one. To understand this distinction, it’s worth examining the build process of a JAMstack site as opposed to a strictly static one.

A JAMstack site is characterized by content living in a git repo alongside code and templates. This allows them to follow a generate-deploy cycle where a site is rebuilt each time a content or code change is made. Because of the git based workflow, every change is a valid commit to git and by extension deploys are immutable. The ability to revert is a key distinguishing factor of the JAMstack. In the past, it was commonplace to deploy sites via FTP, which meant your server and files within it were mutated with each new deploy. Mutable deploys present a host of challenges. These include ever changing and unpredictable server environments and issues with invalid caches. JAMstack sites do away with this by taking advantage the ability for modern CDNs to invalidate your cache completely.

Though JAMstack sites generally include JavaScript, API and prebuilt markup, a site doesn’t need to have every one of these elements to be considered JAMstack. The JAMstack is a direct response to the growing complexities of building for the web and strives for a return to simplicity. It does this by taking advantage of modern build tools, developments in the CDN space (hello edge compute) and a growing API ecosystem to outsource complex functionality. The JAMstack is effectively a movement away from servers. A site can therefore be considered JAMstacks when this architecture is embraced and browsers are given free rein to run the show.

For more on what makes a site "JAMstack", check out the comprehensive guide to the JAMstack published by O'Reilly Media

Discussion (9)

timw4mail profile image
Timothy Warren

"The JAMstack is effectively a movement away from servers."

Nonsense. You call an API you use a server. You have an HTML page, there is a server.

No dynamic server-side rendering seems to be the real idea.

shortdiv profile image
Divya Author

The JAMstack ethos of moving away from servers, is similar to how serverless doesn't mean no servers. What this approach pushes for is a movement away from dynamically rendering content on a server and instead hosting content statically from a CDN. In that regard, it's a movement away from the traditional way of serving content server-side. So yes, you're right in that last sentence.

Also to your comment on HTML pages still living on servers, there is a distinction between a CDN and a web server. A CDN is about speeding up the access/delivery of your website’s assets to users by having a distributed network of edge servers. This is done by having your content live on the server as cached static assets. This is in contrast to traditional servers where 100% of content is rendered on the fly for every single request. Not only does this require a full round trip to the origin server to serve content, it also takes far longer depending on the user's latency and bandwidth.

abeeken profile image
Andrew Beeken

Divya is right here but I think it's largely a problem of the term "serverless" being a bit of a misnomer, which kind of confused me when I first started looking into this methodology.

Yes, it's not SERVERLESS but really what you're not doing is investing in a dedicated server to run your web apps; instead of having to manage your server you're leveraging SERVICES like GitHub, Netlify and AWS to host, build and operate your site.

For me, having had to run websites with a LAMP stack for pretty much all of my career, not having to worry about DevOps and being able to leverage the kind of continuous deployment that you get with GitHub and Netlify is a breath of fresh air - as yet there are specific, really heavy use instances where I can see I'd want to go back to building a site with, say, Wordpress, but there have been many instances in the past where Wordpress and the associated infrastructure required has felt heavy and expensive for simple websites; the Jamstack ideology makes building and deploying such sites an absolute doddle.

charles66982918 profile image
charles hollins

JAMstack is a handy abbreviation and it stands for JavaScript, APIs, and Markup. It represents a modern web development architecture that gives devs an opportunity to rely on the advantages of a static website.

geraldcarrill17 profile image
Gerald Carrillo

It's easy to discover Jamstack websites and applications all over the world! Jamstack is employed by some of the world's leading corporations and brands to offer rich experiences with multiple organizational advantages.

davidjo24054760 profile image
David Johnson

JAMstack is a product design and reasoning that sticks to the accompanying parts: Javascript, APIs, and Markup.

In the event that this sounds recognizable, this is on the grounds that it is! That React application that you accumulate down with Webpack and eventually serve from S3? Correct, that is a JAMstack application. That basic HTML record that has no JavaScript and in a real sense doesn't do anything dynamic? Yes, that is likewise a JAMstack application.

cullens_frank profile image
Frank Cullens

The layout of JAMstack has become famous today, but not the same a few years ago. It can define as shifting burden from the server side to the client side.