Contents
Can you use DDD aggregates in a relational database?
But then, you wouldn’t be considering using DDD aggregates if that were the case. If we are used to designing our domain models by using a relational model, then trying to shove that into a document database will pose many many issues.
How to model aggregates with DDD and Entity Framework?
For everyone who has read my book and/or Effective Aggregate Design, but have been left wondering how to implement Aggregates with Domain-Driven Design (DDD) on the .NET platform using C# and Entity Framework, this post is for you.
What does aggregate mean in Domain Driven Design?
Having experienced the pain of delving into it for the last few months from 0 understanding of DDD, I hope it would help beginners who would possibly have to go through the same things. An aggregate is an encapsulation of entities and value objects (domain objects) which conceptually belong together.
What is the problem with designing two aggregates?
Figure 1. Two Aggregates, which represent two transactional consistency boundaries. The problem that many have with designing Aggregates is that they don’t consider the true business constraints that require data to be transactionally consistent and instead design Aggregates in large clusters as shown in Figure 2.
How to persist aggregates in a domain model?
If we are used to designing our domain models by using a relational model, then trying to shove that into a document database will pose many many issues. Instead, let’s take the aggregate model we’ve been working on and try to persist each aggregate as a document (excluding the Team aggregate).
Which is an example of data in DDD?
In reality, we might have other pieces of data that include Role, for example. A Team Member might have a specific Role within the team that dictates whether they are allowed to remove another Team Member from the Team, for example. Another example might be an Email Address.
How are document persistence models used in DDD?
A document persistence model seems so simple. But it pushes the onus of a well-thought out structure & design out to the domain model itself. In other words, you really need to think about and design your conceptual/domain models well in order for a document model to fit.