Hexagonal Architecture
also called Ports and Adapters
Putting the domain at the centre and letting everything external — UI, database, queues — attach through ports implemented by replaceable adapters.
The domain defines interfaces (ports) describing what it needs: I need to save an order, I need to publish an event. Infrastructure supplies adapters that implement them: a Postgres adapter, a Kafka adapter, an in-memory adapter for tests. Dependencies point inwards, always.
The payoff is that the business logic can be tested with no infrastructure at all, and that swapping a database or a message broker is an adapter change rather than a rewrite. The cost is indirection: every external interaction gains an interface, which is overhead when the domain is thin.
Worth it when the domain logic is genuinely complex. Ceremony when the service is a CRUD wrapper.