Reverse-Engineering DDD: Discovering Domains in Legacy Systems Without the Textbook
The textbook lies. Domain-Driven Design books paint a clean picture: gather domain experts, run Event Storming, discover bounded contexts, design the architecture. Elegant. Logical. Almost never the reality in large enterprises.
Try applying that when you inherit a 30-year-old delivery domain, built by vendors whose contracts ended years ago, powering millions of daily transactions, with logic scattered across monoliths, legacy databases, and black boxes you can't see inside. Nobody wrote it down. The people who built it are gone. You run Event Storming and people tell you how they think the system works — then production logs show it doing something completely different.
This talk is about forensic DDD: treating a legacy system like an archaeological site and using production artefacts — logs, schemas, APIs, incidents, transaction patterns, error codes — to reverse-engineer the domain model that nobody ever documented. Instead of asking "what should the domain look like?", you ask "what domain is already buried in the code, and what evidence can I find to prove it?"
Drawing from 30 years of a delivery domain running in production, I'll walk through practical detective techniques for discovering bounded contexts, aggregates, and hidden business rules from production artefacts. Then: how to reconcile the domain people remember with the one actually running in production — the gap is usually where the real insight lives. Finally, a look at safe, incremental extraction when you can't afford downtime.
Legacy systems aren't just technical debt. They're dense archives of domain knowledge, if you know how to read them.
Key Takeaways:
- Why Event Storming alone falls short in brownfield, and how to use it as hypothesis rather than gospel
- Forensic techniques for reverse-engineering domain boundaries from logs, schemas, APIs, and incidents
- How to reconcile what people think the domain does with what it actually does in production
- Patterns for safely extracting bounded contexts from legacy monoliths without big-bang rewrites
- A mindset shift: legacy systems as archives of domain knowledge, not just debt to escape
About Raj Navakoti
T-shaped Principal engineer (Domain expert, DDD practitioner & AI advocate) @ Ikea