/blog / series/ddd-hexagonal-symfony
$ DDD, CQRS and Hexagonal Architecture in Symfony 8
3 posts, in reading order
Domain-Driven Design and Hexagonal Architecture as they behave in a real Symfony 8 codebase: which component does what, what goes in which YAML file, and where the framework helps versus where it quietly pulls the design apart. The running example is a money-lending domain, built one block at a time.
Each part adds one layer to the same application — the domain model and the dependency rule, the application layer and a working HTTP API, CQRS read models, domain events on an asynchronous Messenger transport, then event sourcing swapped in behind the same port. Every recommendation comes with its cost, and the final part is the bill, measured from the example repository: what all of it buys, and the thresholds below which it is over-engineering.
$ Posts in this series
15 min readNEW
The Domain Model, and the Only Rule That Matters
DDD domain model in PHP 8.5 and Symfony 8: keep the container out of the domain, and choose Doctrine ORM or DBAL with the costs on the table. Series part 1.
DDD, CQRS and Hexagonal Architecture in Symfony 8 · part 1#ddd#hexagonal-architecture#symfony#php#doctrine#software-architecture18 min readNEW
The Application Layer, the Transaction, and a Working API
Application layer in Symfony 8: use cases on a Messenger command bus, the transaction boundary in config, optimistic locking and RFC 9457 errors. Part 2.
DDD, CQRS and Hexagonal Architecture in Symfony 8 · part 2#ddd#hexagonal-architecture#symfony#php#cqrs#messenger#software-architecture15 min readNEW
The Read Side Does Not Go Through the Aggregate
CQRS read models in Symfony 8: a read port the domain does not own, a query bus that returns a value, and when a projection table earns its place. Part 3.
DDD, CQRS and Hexagonal Architecture in Symfony 8 · part 3#cqrs#ddd#hexagonal-architecture#symfony#php#postgresql#doctrine