Architectural Patterns Cheat Sheet
|
This content was generated with the assistance of AI and should be verified against the official documentation before being relied on in production; see the section bibliography for the reference material consulted while preparing these pages. |
A single-page, colour-coded summary of the DDD and microservices essentials — the strategic vocabulary (domain, subdomain types, ubiquitous language, bounded context, context-map relationships), the tactical building blocks in one table (entity / value object / aggregate / repository / factory / domain service / application service / domain event — definition, equality, mutability, where it lives), the aggregate rules, the "why not distributed transactions" one-liners (2PC/XA unsupported, availability product, locks, CAP), the saga box (compensatable / pivot / retriable, choreography vs. orchestration, the six countermeasures), the domain-event checklist, outbox vs. listen-to-yourself vs. event sourcing in a three-column comparison, the CQRS box, the event-sourcing box, the code-layout skeleton, and the Spring class mapping — handy for quick memorization or as a printable desk reference.
For the full explanation, every rule, and complete code examples, see the dedicated pages:
Foundations — Strategic design for microservices and Structuring a DDD microservice’s code.
Tactical building blocks — Entities, Value objects, Aggregates, and Repositories, factories, and domain services.
Consistency across services — Why distributed transactions don’t work across microservices, Sagas, Domain events, Event storming, The transactional outbox pattern, Listen to yourself, CQRS, and Event sourcing.
Putting it all together — Putting it all together: the Place Order flow.