Should i have for each Domain a separate database in DDD?EF MVC codefirst

c#, code-first, domain-driven-design, entity-framework

Solution

You managed to split the application into multiple bounded contexts (`BCs`), one for each domain (sub-domain). This is the perfect situation.

In this case you should have separate databases (or at least separate tables/collections) for each bounded context. In order to shared data from one `BC` to other `BC` you should use the Context mapping strategic DDD pattern to see what is the best technique (depending on your architecture you could use an Anti-corruption layer to share the data between an upstream and a downstream `BC`).

Read more here about integration types between `BCs`.

PS. In the book Domain-Driven Design Distilled by Vaughn Vernon you can find some integration examples.

Problem

I am so new in DDD. I have a project with 6 Domains. In each domain i have my inf and app layer.My question is about my database.I use entity framework code first (MVC ASP). Should i create for each domain a separate database ?

Original source