Disambiguating Jamstack and MACH
Tags: javascript, api, microservices, mach
Published: 2022-08-22 14:37:00

> This article originally appeared on my personal dev blog: [Byte High, No Limit](https://andrewowen.net/blog/).

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](https://jamstack.org/ "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](https://www.jslint.com/  "JSLint") can help you write better JavaScript and [JSMin](https://www.crockford.com/jsmin.html "JSMin") can minify your code before deployment. These tools were created by Douglas Crockford. I would recommend his books [JavaScript: The Good Parts](https://www.bookdepository.com/JavaScript-Good-Parts-Douglas-Crockford/9780596517748 "JavaScript: The Good Parts") for programmers coming to JavaScript for the first time, and [How JavaScript Works](https://www.bookdepository.com/How-JavaScript-Works-Douglas-Crockford/9781949815009 "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](https://en.wikipedia.org/wiki/YAML "YAML") (Yet Another Markup Language) or [Markdown](https://en.wikipedia.org/wiki/Markdown "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](https://gohugo.io/ "Hugo") and [Gatsby](https://www.gatsbyjs.com/ "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](https://forestry.io/ "Forestry") and automated deployment solutions such as [Netlify](https://www.netlify.com/ "Netlify") that connect to cloud source repositories such as [GitHub](https://github.com/ "GitHub").

Those are the technologies I used to build this website. You can read about it in [this blog post](../setting-up-a-free-personal-website-with-forestry-github-hugo-and-netlify/). 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](https://en.wikipedia.org/wiki/Distributed_computing "distributed computing").

#### The MACH Alliance

Named for the acronym it created, the [MACH Alliance](https://machalliance.org/ "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](https://andrewowen.net/blog/explaining-event-driven-architectures/ "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.