concept

Hexagonal Architecture

Hexagonal Architecture, also known as Ports and Adapters, is a software design pattern that aims to create loosely coupled application components by separating the core business logic from external concerns like databases, user interfaces, or third-party services. It organizes the system into a central domain layer (the hexagon) surrounded by adapters that handle input/output, allowing the core to remain independent of external technologies. This pattern promotes testability, maintainability, and flexibility in software development.

Also known as: Ports and Adapters, Onion Architecture, Clean Architecture, Hexagon Pattern, Ports-Adapters
🧊Why learn Hexagonal Architecture?

Developers should use Hexagonal Architecture when building complex applications that require high testability, such as enterprise systems or microservices, as it isolates business logic for easier unit testing without external dependencies. It is ideal for projects needing to adapt to changing technologies (e.g., swapping databases or APIs) without modifying core code, and for teams following Domain-Driven Design (DDD) to enforce clear boundaries between domain and infrastructure layers.

Compare Hexagonal Architecture

Learning Resources

Related Tools

Alternatives to Hexagonal Architecture