Hexagonal Architecture

A layered architecture style that isolates domain logic from infrastructure via ports and adapters.

What is Hexagonal Architecture?

Hexagonal (a.k.a. ports and adapters) treats the domain as the center and surrounds it with ports — interfaces it uses to reach the outside world — and adapters — implementations of those ports for specific tech (HTTP, SQL, Kafka). The payoff is a domain that is testable in isolation and infrastructure that can be swapped without touching business rules.

Also known as: ports and adapters.

Related terms

  • Clean Architecture — A layered architecture where dependencies point inward toward the domain, popularized by Robert C. Martin.
  • Domain-Driven Design (DDD) — An approach to software design that centers the model and language of the business domain.