DDD - Consistency of Entity Across Bounded Context & Different Schemas in Database

c# domain-driven-design entity-framework entity-framework-6

Question

I am implementing DDD with Entity Framework Code First. My Domain Model is persisted as it is without any mapping layer.

I am following approach suggested during Tech-Ed by Julie Lerman. Each bounded context maps to different schema within same database.

If same entity say, Customer appears across different bounded contexts how do we maintain consistency of data for Customer entity?

1
6
12/21/2015 7:12:50 PM

Popular Answer

Only a single bounded context will be the system of record for your entity. If you cannot get away with simply an Id in the other BCs then you can include a subset of the entity (usually not all the properties) as a value object.

Any changes to the entity in the SOR should be published as one or more events in a messaging system that the downstream BCs subscribe to in order to keep their data eventually consistent.

8
6/30/2016 4:17:15 AM


Related Questions





Related

Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow