DEV Community

Cover image for Disambiguating Jamstack and MACH
Andrew Owen
Andrew Owen

Posted on • Edited on

Disambiguating Jamstack and MACH

This article originally appeared on my personal dev blog: Byte High, No Limit.

Earlier this year, I gave a lightning talk on API-first. I've been planning to do a post on it ever since, but first I wanted to lay the groundwork. Last week I covered event-driven architectures. That was quite a lot to digest. Today's post is a quick overview of what the cryptically-named Jamstack and MACH are really all about.

Jamstack

The J in Jamstack stands for JavaScript. If you try running modern applications on a 12-year-old computer, you'll find most of them run just fine. The exception is the browser. Even with a wired connection, many web pages load at a crawl. The reason for this is twofold. Those web pages have become full-blown applications, and they are written in an interpreted language (JavaScript) that requires a lot of processing power to run at an acceptable speed.

Programmers of classical languages hate JavaScript because it's prototype-based, dynamic and weakly typed (among other complaints). It's also the number one most in-demand programming language in 2022 according to a number of independent surveys. JSLint can help you write better JavaScript and JSMin can minify your code before deployment. These tools were created by Douglas Crockford. I would recommend his books JavaScript: The Good Parts for programmers coming to JavaScript for the first time, and How JavaScript Works for experienced JavaScript programmers.

The A in Jamstack stands for APIs, which in turn is short for web APIs. There are a variety of different web APIs but currently, RESTful APIs seem to be the most popular. REST is an acronym for REpresentational State Transfer, which in real terms typically means using HTTP methods to pass parameters in JSON (JavaScript Object Notation) format. Unsurprisingly, JSON was also created by Crockford.

The M in Jamstack stands for Markup: information included in an electronic document that is distinct from its content. Traditionally, markup meant HTML and XML. But now it's as likely to refer to YAML (Yet Another Markup Language) or Markdown. These are much simpler, and therefore easier for humans to read, than other markup languages.

Markdown is increasingly being used for software documentation, but you'll also find it used in static site generators (SSGs) such as Hugo and Gatsby. SSGs combine Markdown with templates to make it easy to spin up a website with minimal effort. They integrate with headless content management system (CMS) providers such Forestry and automated deployment solutions such as Netlify that connect to cloud source repositories such as GitHub.

Those are the technologies I used to build this website. You can read about it in this blog post. That covers the web presentation side. But that's only one component of a software solution. The old way of doing things was to create monolithic software that customers would host on their own hardware, with gaps of months or even years between updates. In some respects, the new way of doing things is simply a return to distributed computing.

The MACH Alliance

Named for the acronym it created, the MACH Alliance exists to promote a particular way of doing things. MACH stands for Microservices, API-first, Cloud-native, Headless. I covered microservices in last week's post on event driven architectures (which are a step beyond MACH). As stated in the introduction, I'll cover API-first next week, but the APIs in question are typically the ones I described in relation to Jamstack.

Cloud-native means that software solutions are hosted by cloud providers such as Amazon, Google and Microsoft rather than on on-premises servers. Headless means that the content is separate from the presentation.

With that out of the way, I can get on with writing my post on API-first.

Top comments (0)