Implementation patterns
We have looked at integration between bounded contexts at a design level, but these concepts need to be translated into code. There are three broad categories that can be employed when integrating two bounded contexts:
- Data-based
- Code-based
- API-based
Let’s look at each method in more detail now.
Data-based
In this style of integration, the bounded contexts in question share data with each other. If the relationship is symmetric, the teams owning these bounded contexts may choose to share entire databases with free access to read, write, and change underlying structures. Conversely, in an asymmetric relationship, the supplier may constrain the scope of access, based on the type of relationship.
Shared database
The simplest form of data integration is the use of a shared database. In this style of integration, all participating bounded contexts have unrestricted access to the schemas and the underlying data, as shown here...