By clicking “Accept All Cookies”, you agree to the storing of cookies on your device to enhance site navigation, analyze site usage, and assist in our marketing efforts. View our Privacy Policy for more information.

ARTICLE

Mighty robust software with the MACH pattern

October 1, 2024
-
Tim Severien

Software platforms are like digital clockworks. Underneath the surface lies an elaborate puzzle where all parts work in tandem to make a system run. However, unlike clockworks, software progressively changes to reflect new insights and meet changing needs.

At fresk.digital, we believe products can evolve after their initial release, which is why we Optimise & Grow. Consequently, the software that we build must be flexible enough to let us do that. MACH is a crucial part of that.

What is MACH?

MACH is an architectural pattern for product development. The abbreviation stands for microservices-based, API-first, cloud-native, and headless, and each concept contributes to making software more flexible. Let’s explore each concept.

Microservices is an approach to software development where stand-alone components are connected to create a system. This gives us a lot of flexibility as we can move and swap individual parts. It’s similar to replacing a cog in a watch — we only have to replace one part and make sure the new cog interlocks with tangent ones. For digital solutions this means that you don’t have to jump through hoops to make changes, the adaptability makes it flexible and therefore scalable for the future.

API-first means application programming interfaces are treated as first-class citizens. To put it plainly, it means that we can interact with components through code, such as through an HTTP API — we make sure our cogs have teeth we can hook into. While APIs are necessary to make the system work at all, well-designed APIs save development time and ensure performance.

Cloud-native services are services that run in the cloud. Cloud platforms, such as Microsoft Azure, Amazon Web Services, and Google Cloud, offer unparalleled security, stability, and scalability, and are leveraged by many software as a service (SaaS) tools.

Finally, headless means that presentation is decoupled, enabling us to learn, adapt, and iterate on front-end applications without affecting the back-end, saving a tremendous amount of development time. We can change our clockwork’s face without also having to alter its internals.

All-in-all, MACH ensures that a platform is adaptable. The pattern encourages composability, enabling us to combine the components we need to build a front-end. Leveraging the cloud further enables us to scale, ensuring stability and performance as the platform and its usage grows. This kind of adaptability is invaluable for every software project, be it a website that unexpectedly experiences a surge in usage, or a platform that needs to phase out old systems in favor of new ones without downtime, or a product that needs pivot, like for our client Ravlling.

MACH in practice

For Ravlling, a platform for travelers to discover destinations, we initially developed a web app in 2023. Earlier this year, we developed and released a significant iteration — colloquially known as the platform pivot.

Before the pivot, the web application only depended on a graph database and authentication service. The database stored a vast amount of activities, accommodations, and more. The authentication service allowed users to log into the website and pick favorites.

The pivot drastically changed that. A prominent feature we iterated on was the search functionality, for which we leveraged an artificial intelligence (AI) service that could perform natural language processing (NLP). Moreover, we gave Ravlling more control over content by introducing a content management system (CMS).

Thanks to the cloud-native SaaS we leveraged, it only took a couple of clicks to replicate the database, integration and deployment pipelines. This enabled us to iterate and experiment on the new platform while the pre-pivot platform hummed along. Swapping them over to go live with the new platform was also a matter of mere clicks. Moreover, because the front-end already served as the mediator of several back-end microservices, that’s where we recomposed the architecture and connected to other services.

Thanks to MACH, we were able to reuse our infrastructure and much of the services that were already available — no rewrites necessary.

"MACH keeps systems adaptable, scales and enables innovation.

Complex yet simple

Because MACH systems are composed of many smaller components, we can create incredibly large systems that are complex, yet simple. An example of this is Sportinfrastructuur platform for our client NOC*NSF.

This platform leans on the Azure ecosystem and a handful of external sources. To give you an impression: there’s a web application, content-delivery network, authentication service, CMS, event messaging system, system monitoring services, blob storage, several databases, a host of highly specialized services to power various features, and many more components, each carefully wired together.

The fact that the system is huge, doesn’t mean it’s fragile or that it can’t adapt. Remember, we’re leveraging a lot of microservices here, each performing a specialized task. With a push of a button or two, we can add, replace, remove, or rewire them. Things are only fragile when a simple change causes unexpected problems. While some services do depend on others, each of them runs autonomously and smoothly in the cloud.

This platform demonstrates that MACH is more than theory or a pattern for tiny projects — it works for incredibly ambitious and large-scale projects, too, and it will continue to do so as the platform evolves.

Conclusion

MACH keeps systems adaptable. Be it because of new insights, changing needs, or technical advancements, software is subject to change. Just like we don’t need a new watch to repair the clockwork or change the clock face, we don’t need to rebuild software from scratch.

MACH scales. By leveraging microservices, SaaS, and the cloud, and putting emphasis on composition, we get a setup that will serve us from the start, that will serve us as we grow, and that will serve us in the future. We can scale individual components, introduce new parts to manage loads, and grow the product to our hearts content.

MACH enables innovation. With all these individual components doing their part, we can recombine them in interesting ways. When several data streams are combined to power a web application, why not pass some of that information to your business intelligence tool to get meaningful insights?

MORE INFORMATION?

Get in touch