What is it

JAMStack stands for Javascript Api and Markup.  Although really, that's a bit muddled.  Once deployed they are primarily markup, with interactive features and API data sprinkled on top with Javascript.

JAMStack has made a splash over the last few years because it turns what has become the norm of web development on it's head. It is the opposite of Wordpress.  Instead of a complex backend delivering markup and functionality, JAMStack has the simplest back end possible delivering Markup, CSS and JS directly.

What can it do

At first glance, it might seem like JAMStack is a euphemism for basic html websites.  It's much more than that.  It has become an ecosystem of web-tech, static site builders, dedicated hosting platforms, content delivery networks and services.  With this ecosystem, it can do pretty much anything - authentication, membership sites, ecommerce.  Really anything. That doesn't mean it's ideal for those but if the advantages outweigh the disadvantages for your site, it's possible.  As with any technology choice, it's about figuring out where it's sweet spot is.

Why is it good

There are two great things about JAMStack.  The quality of the resulting website and the development experience.  JamStack sites are fast and secure with consistent design. Building them is a clear and pleasant task that keeps everything organised in a way that leverages web skills to quickly build design features.  Let's look at those advantages in a bit more detail.

Speed

The overhead of a web server running backend code and database queries is removed, replaced with a pre-compile step.  The resulting HTML site is as fast as is possible and because it is static, you can deploy it to a CDN with worldwide locations and caching - resulting in a sub 50ms loading website.

Scale

Once the site is deployed to a robust CDN huge traffic can be served without any bottlenecks or limits.

Security

There is a lot less to hack when your website does not run on a server with backend code, databases and other exploitable weaknesses.

Development Experience

The simplicity, workflow, template languages and git integration of design and content make JAMStack a nice place to work. 

How to do it

JAMStack sites are usually pre-generated using a Static Site Generator.  There are a lot to choose from using whatever code and template language the developer prefers.  Ruby has a few, including Jekyll which is supported by all JAMStack CMS and Github.com pages.

When running locally, the developer writes the templates and sees the results instantly in the browser as the template language compiles on the fly and loads any changes in the JS and CSS. This enables the use of Sass, JS bundling and HTML includes.  The resulting website - the HTML, CSS, JS and media assets - is then exported for deployment and pushed to the hosting location.  Deployment is as simple as it gets.  Just run your static site build command and copy the files onto your server.  

This provides a really pleasant, fast and organised way to build a website and to continue to maintain it over time.

If your site has content that needs regular updating it's simple to set up a cloud based CMS that commits back to the site's git repo and triggers a deploy.  So all your templates and content are always in sync. There are lots of these systems available such as Forestry.io (pictured),

forestry

For standard functionality there is usually a service.  For example if you want to add a contact form to your site, you will need somewhere to submit the responses.  Dedicated Form services like FormKeep will collect the submissions,  trigger responses and return the user to a thank you page.  No code required.

If you want to push the boundary of what you can do with HTML/CSS/JS to build things like authentication you will need to use a service like netlify functions - which allow for distributed "server-side code that works as API endpoints to process data, connect APIs, and build dynamic experiences".  Netlify offer a complete suite of advanced functionality for static sites including authentication, forms and custom edge functions - allowing almost any functionality.

What is it best for

Jamstack is a good fit when you want a fast, secure high quality website with consistent design maintained by your web team.  Lots of content or Forms is fine.   Features like authentication, membership areas and eCommerce are possible but the more complex the requirements become the less clear cut the advantages are, however if speed and scalability are vital it still might be the right fit.

Wrap Up

JAMstack is a refreshing way to build websites that is unbeatable really in terms of speed, scalability and developer workflow. For the right project, JAMStack for the win!