Bounded Context Data Mapping

One of the peculiarities of DDD bounded contexts, as I understand it, is that they are boundaries within which the ubiquitous language has no ambiguity. In this case, if there is a product idea in the system, then the product may be different when it comes to buying a product from a reseller or selling a product to someone. In truth, the business logic may even change: there may be some sort of discount logic when selling that doesn't make sense when buying a product. In this case, we isolate the ubiquitous language by creating two bounded contexts. There is a product concept within this, but they mean different things.

This is because there is usually a lot of duplicate data. For example, in the product example, the product name, category, description are examples of things that would be the same. My doubt here is not about linking these duplicate information by code, but rather when saving data.

How can we deal with this duplicate data while storing it in the data warehouse? Is there one recommended way to tie it or do we just keep it separate, no matter how redundant it is?

+3


source to share


2 answers


Bounded Contexts should not use the same data store. If you have multiple bounded contexts, each with an object Product

, then there will most likely be a table / collection for each of those bounded contexts to store Products

.



+2


source


You can use RPC as a way to integrate bounded contexts, but it really should be limited in use. However, sometimes you need current data (price) and therefore this is an acceptable practice.



+2


source







All Articles