--
Today we are introducing MACH composer, a framework that helps you to build modern MACH architectures. And it is is available open source!
As described in our previous blog post about MACH, we think there is a need for a standard for building MACH architectures. By open sourcing MACH composer, we allow a wider group to use and contribute to it, and perhaps for the project to become standard practise across the industry.
If you want to dive straight in to the code, then follow this link:
Though we recommend going through the tutorial first.
At Lab Digital, we have been building MACH platforms for a number of years, which has lead to the creation of our framework MACH composer. We have been using MACH composer in production for a number of projects and clients, and are now open sourcing it to make it usable outside of our company as well.
It is our hope and goal that this will create a community that builds, maintains and extends MACH architectures in a consistent and coherent way, which will increase productivity among MACH-developers and users, and bring the overall movement further. Ultimately delivering more value to customers that embrace MACH.
MACH composer offers you a structured and standardised approach for combining MACH systems (SAAS platforms such as commercetools, contentful and Amplience), with serverless microservices architectures, deployed in either AWS or Azure (and GCP is in progress). And on top of that, multi-tenancy support is built in, so that you can model larger digital commerce ecosystems.
MACH composer is primarily a CLI utility that you can use from a developer workflow perspective, as well as CI/CD context. So you can manage your platform during development as well as production in an automated way.
In MACH composer, everything is infrastructure-as-code
Ultimately, MACH composer is an infrastructure-as-code-generator, with Terraform as the engine underneath doing the heavy lifting. MACH composer provides a configuration framework on top of that, to make larger platforms easier to manage. In other words: in MACH composer, everything is infrastructure as code. And this includes managing the likes of 3rd party, API-based SAAS platforms such as commercetools and Amplience.
Having a good understanding of Terraform and infrastructure-as-code principles, is necessary for rolling out MACH composer, as every aspect of a MACH composer project is ultimately managed like that.
Or at least, attempt to.
Managing MACH platforms as a version-control managed whole
Providing a ‘mental model’ of how to structure/configure 3rd party MACH services against additions, customisations, front-ends and the cloud platforms that comprise the MACH architecture
Combining multiple MACH services into one platform that powers user experiences
Extending MACH services in a consistent (and serverless) way across independent teams
Providing a best practise way of exposing services through API gateways (including GraphQL / Apollo)
Standardisation of CI/CD across the MACH platform, both for infrastructure as well as serverless functions
Secrets management for both MACH services and generic secrets
Managing larger MACH deployments as a developer
Facilitating public and private re-use of micro services
Cloud Native integration of MACH architectures with popular cloud platforms (Azure, AWS and soon GCP)
Standardise the ‘way of working’ with MACH platforms
Multi tenancy for MACH architecture: build once and replicate to many use cases, based on blueprints.
Managing multiple distributed development environments with ease (i.e. one environment per developer).
At Lab Digital, we use MACH composer for any project that is built around MACH principles. We have use cases that are a single brand webshop in a single country, to ecosystems that span many countries, brands and organisations — and therefore many commercetools projects, Amplience hubs or contentful spaces. MACH composer can be used for all types of projects and is not tied to a single SAAS service (i.e. “contentful-only” MACH composer projects are perfectly sensible).
By building your projects with MACH composer, the components in it become inherently more reusable, as it implements a composable approach by default, including enforcement of principles such as 12 Factor Methodology. And by building those components using serverless technology, they really become the ‘Lego blocks’ promise that microservices can bring.
The main SAAS services that MACH composer has first class support for, are currently commercetools, Amplience, contentful and Sentry. Furthermore, it supports AWS as well as Azure as the cloud platform that every customisation is deployed on. And we have implemented initial support for Apollo Studio, so that you can manage your distributed GraphQL Federation server.
For services that are not supported yet, there are ample options. Primarily anything that has a Terraform provider can be integrated in MACH composer seamlessly. But in general, services that have a management API, are supported by MACH composer, as you can also manage generic REST, GraphQL or even CLI resources through Terraform. More on that here.
MACH composer offers complete and production-tested implementations on AWS and Azure, but not yet on GCP.
This is purely a ‘didn't need it yet’ matter; at Lab Digital we work with AWS and Azure as our main cloud platforms, and GCP is not yet part of that.
Implementing GCP support in MACH composer is relatively straightforward, as there is full support for it in Terraform. We have recently started work on this with another partner in the MACH ecosystem, Incentro, as they want to use MACH composer, but with GCP as the cloud platform of choice. So stay tuned :).
The full MACH composer project and documentation is available at machcomposer.io. There you will find an introduction to using MACH composer, links to the Github projects that MACH composer is built on, and a tutorial to get you started with a sample commercetools deployment.
And if you need help we’re always happy to answer questions either on Github, or by email mach@labdigital.nl.