Member-only story

Microservices Vs Hexagonal Architecture

HouseOfCoder
3 min readMay 29, 2024

Microservices architecture and Hexagonal architecture are two different architectural styles with distinct characteristics and purposes. Let’s discuss them briefly below:

Microservices Architecture

Microservices is an architectural style that structures an application as a collection of loosely coupled services. Each service is focused on a specific business capability and can be developed, deployed, and scaled independently.

Example of Microservices architecture, Credits: microservices.io

Characteristics:

  • Decentralized: Each microservice is autonomous and can be developed and deployed independently.
  • Scalability: Services can be scaled horizontally based on demand.
  • Technology Diversity: Different services can use different technologies and programming languages.
  • Resilience: Failure of one service does not affect the entire system; it can degrade gracefully.
  • Communication: Services communicate through APIs, often using lightweight protocols like HTTP/REST or messaging queues.

Advantages:

  • Agility and Flexibility: Easier to modify and update individual services without affecting the entire system.
  • Scalability: Can scale specific services based on demand.

Create an account to read the full story.

The author made this story available to Medium members only.
If you’re new to Medium, create a new account to read this story on us.

Or, continue in mobile web

Already have an account? Sign in

HouseOfCoder
HouseOfCoder

Written by HouseOfCoder

Web developer by profession. Crafting code and contemplative thoughts. Join me on a journey of tech, life, and mindfulness.

Responses (3)

Write a response

Why compare these two patterns? I find it hard to see these as competing architectural patterns.

Ports and adapters decouple business logic from technical concerns.

Microservices address organizational scale and technical scale concerns by decoupling features/domains so they can be autonomously deployed.

I don't understand why opposite these two patterns. In fact, you can use Hexagonale architecture to build each microservice.
These patterns are not on the same level. there is one for organizing domains among themselves and the other for structuring the code of a given domain

As Leo mentioned, these two architectures have the only commonality of separation concerns (which is missing in the microservices advantages). Other than that, the reasons for having them are way, way different. And in fact, in some ways, the one…