DDD
A software design approach that puts the business domain at the center of your architecture and code.
Domain-Driven Design is a set of ideas for building software that closely mirrors the business domain it serves. The key idea is that if developers and business people share the same language and the same model, the software stays aligned with what the business actually needs.
In practice, DDD gives you tools at two levels. Strategic DDD helps you figure out how to split a system into parts that make sense: bounded contexts, context maps, and a shared ubiquitous language. Tactical DDD gives you building blocks for structuring code within each part: aggregates, entities, value objects, domain events, and repositories.
Event Storming is the technique we lean on most for the strategic side. It's how you discover bounded contexts, aggregates, and the ubiquitous language together with the people who actually know the domain.
You don't need to adopt everything at once. Start with a proper domain layer that has no database imports, use aggregates to enforce invariants, and let the repository pattern handle persistence. That alone changes how maintainable your codebase is.
DDD works best when the domain is complex enough to justify the investment. For CRUD apps with little business logic, it adds unnecessary ceremony. But once you have non-trivial rules, multiple stakeholders, or a system that needs to evolve over years, DDD patterns help you keep the complexity in check.
References
- Introduction to DDD Lite: When microservices in Go are not enough — Introduces DDD Lite as a pragmatic, Go-idiomatic take on Domain-Driven Design. Covers entities, value objects, and keeping the domain layer database-agnostic.
- Combining DDD, CQRS, and Clean Architecture in Go — Shows how DDD, CQRS, and Clean Architecture complement each other in a real Go project, with repository refactoring and aggregate patterns.
- Software Dark Ages — Deep dive into Strategic DDD patterns. Covers bounded contexts, ubiquitous language, and Event Storming as tools to escape the Software Dark Ages and build loosely coupled architectures.
- The Repository pattern in Go: a painless way to simplify your service logic — Implements the repository pattern using DDD Lite. Shows how to separate domain logic from database implementation with MySQL, Firestore, and in-memory repositories.
- How to use basic CQRS in Go — Combines CQRS with DDD Lite to split complex models into commands and queries. Refactors existing models to DDD Lite during the CQRS introduction.
- How to implement Clean Architecture in Go (Golang) — Shows how to apply Clean Architecture in Go with a domain layer following Domain-Driven Design. Separates ports, adapters, and application logic from the domain.
- Repository secure by design: how to sleep better without fear of security vulnerabilities — Uses DDD domain layer patterns to build repositories that are secure by design. Shows how encapsulated domain types prevent security vulnerabilities.
- Common Anti-Patterns in Go Web Applications — Discusses DDD patterns like Value Objects, Aggregates, Repositories, and Ubiquitous Language as solutions to common anti-patterns in Go web applications.
- Database Transactions in Go with Layered Architecture — Covers DDD's aggregate concept for defining transaction boundaries. Shows how to handle transactions cleanly with the repository pattern in layered architectures.
- DDD: A Toolbox, Not a Religion — Discussion on treating DDD as a practical toolkit rather than a strict methodology. Covers strategic vs tactical patterns and when to apply each.
- How to Know If your Software Is Overcomplicated or Oversimplified? — Discusses DDD as a pattern for tackling complex domains. Mentions the Go with the Domain ebook and matching the right level of patterns to domain complexity.
- Is Clean Architecture Overengineering? — Discusses when DDD and Clean Architecture add value vs. when they become overengineering. Covers the DDD domain layer and when it's worth introducing.
- AMA #1: Clean Architecture, Learning, Event-Driven, Go — Community Q&A covering DDD topics. Discusses the new DDD training, when to use a domain layer, and practical DDD adoption in Go projects.
- Event-Driven Architecture: The Hard Parts — Discusses connections between DDD and event-driven architecture. Covers how DDD aggregates and bounded contexts inform event design and service boundaries.