Search
  • Dmytrii Stepanenko

What’s MACH architecture?


What’s MACH architecture?

Overview

Over the past 10 years, the world of software development changed from classic, monolith applications, SOA and Enterprise Service Buses, deployed on-premises, into cloud-based, microservice-oriented, off-the-shelve where possible apps. Javascript evolved from jQuery to React, Angular and Vue. Backend technologies changed too, with the evolution of Node.js, serverless and no-code.

In this article, we will try to assess current state of technology that has started to be referenced as MACH.

So MACH is a Microservice, API-first, Cloud-native and Headless. It perfectly represents core aspects of modern software design.

Microservice.

A solution, based of microservices is something that replaces standard monolith architecture, where each microservice is built agains it’s purpose, where it’s by business purpose (payment service, auth service, reporting service), by entity (user service, catalog service, transaction service), or even by endpoint (/user, /company, /document). These microservices are communicating through their APIs or Message Broker and can have packaged frontends for each service, or mono front-end (deployed separately).

Also, developers still argue about the concepts of microservices since it’s not clear where the line between micro and non-micro is.

The rise of microservices is attached to the rise of containerization/dockerization, which also resulted into evolution of Kubernetes (K8s), Docker Swarm and other container-based infrastructures.

Having microservices allows company to have better segregation and maintainability of different parts of their products, using different technologies to build these services, more flexible scaling and resource utilization, ability to upgrade/replace services without touching/braking others. However, often it’s not true and some microservices are tightly coupled to others.

The disadvantage of having microservices is an overhead to integrate them through APIs/Message Broker, more complex error-handling, difficulties in implementation of distributed transactions and others.

API-first.

This principle is connected to the microservices approach as it’s dictates to always build APIs and connect systems through those APIs. Also, with the evolution of front-end technologies like React, APIs became the only way to exchange data between user’s browsers and backends, and older JSP-like approaches had disappeared. In the modern architecture, there are usually hundreds of different endpoints that has different business purposes, sometimes repeating, sometimes complex.

There are 2 popular API protocols: RESTful and GraphQL. Most systems are getting along with REST + JSON, but sometimes GraphQL gives more advantages for big APIs with large responses and transaction-like operations.

Also, sometimes server needs to “push” data to the frontend via websockets — this is where GraphQL has advantage over REST, by providing GraphQL subscriptions, powered by the websockets. Websockets are not used for server-server communication.

Cloud-native.

This principle dictates that all solutions are not only deployed to the cloud (like AWS or Azure), but also built keeping in mind the variety of modern cloud services: databases like AWS Dynamo, authentication tools like AWS Cognito, big data frameworks like Google Big Query, serverless Google Functions and many more.

For small enterprises, cloud is the only viable option to start building POC and MVP, but also risky given potential explosion in cost when technology is not use correctly.

For bigger enterprises, cloud brings benefits too, like multi-zone availability, potential cost reduction with autoscaling and etc.

Headless.

The only principle that’s harder to define and follow, and more rarely used, but in a nutshell it defines user interface as rather multi-channel over omni-channel thing. As a result, the company will have multiple consumer experiences, from kick-ass modern frontends to messengers, voice, AR and others.

Summary

It’s important to understand that technology evolves every year and to be aligned with new approaches and their pros/cons. We’re still in evolution cycle where 5 years from now, microservices and cloud solutions can be legacy comparing to.. well, we don’t know what yet. But the journey is exciting :)

At Blackbird Labs, we’re helping startups and product companies to adopt MACH architecture, by building container-based microservices, React frontends, AR experiences, SMS marketing tools and etc. From my point of view:

90% of our projects are Microservice 90% of our project are API-first, 100% of our project are Cloud-native 25% of our project are Headless.

29 views0 comments