Comparison
Hexagonal architecturevsOnion architecture
Hexagonal architecture
the same use case runs from an HTTP handler, a message consumer and a test, and none of them is the primary one.
An arrangement where the application defines ports — interfaces for what it needs and what it offers — and adapters implement them for HTTP, databases, queues or tests. The hexagon shape carries no meaning beyond having several sides; the content is that the application never depends on a delivery mechanism or a storage technology. It makes the application testable in isolation and adds an interface plus an adapter for every boundary, which is real work for a small service.
Full entry →Onion architecture
the domain model sits in the middle with no dependencies at all, and everything else wraps around it.
Palermo's layering with the domain model at the centre, domain services around it, application services outside those and infrastructure at the edge, with all coupling directed inward. It is the middle term between traditional layering and hexagonal architecture, and it is the one that states most explicitly that the domain model has no dependencies. The three are close enough that most teams pick one name and stop.
Full entry →