Skip to main content

Hexagonal Architecture


What is it

The hexagonal architecture, or ports and adapters architecture, is an architectural pattern used in software design. It aims at creating loosely coupled application components that can be easily connected to their software environment by means of ports and adapters. This makes components exchangeable at any level and facilitates test automation.

Why we use it

To isolate our core logic from our input and out ports, which both makes it easier to test and more resilient to changes outside the application.

We also use it to adhere a well established pattern to make sure microservices looks the same and to make it easier to onboard new employees, since following a pattern increases the likelihood that the person have worked with it before.

When to use it

When building a more complex service which could benefit of more structure.

How to learn it

There are several articles and YouTube videos about it, will link a few below:

  • Alistair Cockburn (the inventor) has an article about it
  • Netflix Techblog have an article about it
  • Wikipedia article
  • YouTube video