Modern Web Development on the Jamstack

New Techniques for Ultra Fast Sites and Web Applications

By Mathias Biilmann, Phil Hawksworth






Feb 12, 2020


Feb 21, 2020

PurchaseExternal link
In today’s world of ubiquitous frontend-heavy web applications, it’s difficult to absorb just how revolutionary it was to move from rely‐ ing on complete page refreshes as the only way of truly interacting with a web application to suddenly having the option of initiating HTTP requests straight from JavaScript.”
Web was originally document based—effectively a read-only store of static docs
SPA’s couldn’t exist until JS was feature-rich and optimized to the point that doing work on the client side was not horribly painful
This was a major benefit to both developers (simpler asset pipelines, unique tools specifically for frontend dev and testing, etc.) and for consumers (better UX, more rich features)
Static site generators also could not exist at this time; websites with on the order of thousands of pages simply took too long to build
Smarter branching, caching, and simply better compute makes this possible today (really only over the past few years)
My thoughts: it’s so easy to take this incredible performance and dev tool environment for granted when there have been decades of evolution behind them
“For the majority of content-driven sites, as long as a deploy can be scheduled to go live at a certain time, being able to run a build cycle in less than 10 minutes is likely not of real importance. Unless your site is truly gigantic (pages counted in millions rather than thou‐ sands), a JAMstack approach might be a more viable option than you would have once thought.”
There are security benefits to this structure, as well:
“Decoupling the build stage completely from the runtime of the system and publishing pre-baked assets constructs an unbreakable wall between the runtime environment end users interact with and the space where code runs. This makes it so much easier to design, develop, and maintain the runtime in isolation from the build stage.”
Beauty of the web ecosystem:
“We can use third-party tools to outsource complexity and rest easy in the knowledge that those providers have highly specialized teams focusing exclusively on their problem space.”
“Zero code will always be more secure than even the smallest amount of code. Assets that can be served without any moving parts will always be easier to scale than even the most highly optimized dynamic pro‐ gram…The only reason to run server-side code at request time ought to be that we absolutely cannot avoid it.”
“This model of loose coupling between different parts of a site’s technical architecture lowers the barriers to change over time. This can be liberating when it comes to making technical design decisions because we are less likely to be locked into one particular third-party vendor or service, given that we have well-defined boundaries and responsibilities across the site.” Find errors at build time, not when the user actually goes to your site.
In response to caches, “In other words, dynamic sites add an extra layer of complexity just to allow them to be served with static hosting infrastructure to satisfy demand at scale.”
Also, as we already know, speed kills. They put this in clear terms: “BBC has seen that they lose an additional 10% of users for every additional second it takes for their site to load.”
Move from mutable to immutable builds: “delivered as entirely self-contained sets of assets, with no dependency on what came before, and associated with a moment in time in our version control system. As a result, we gain confidence and agility.”
Allows for agile rollbacks
Atomic builds: if any part of the build fails, the new deploy is never pushed

← Back to all books