A shared kernel is a deliberately bounded subset of a domain model that multiple teams agree to share. It includes the relevant code or database design, and changes require consultation with every affected team. section 10.3.1
Four teams sharing one model
During a proposed monolith-to-microservices transition, four teams owned separate bounded contexts but depended on one shared model. Any change required discussion with the other teams and could force changes across their models, reducing autonomy and slowing releases. section 10.3.1
Use a shared kernel deliberately:
- Keep the shared subset concise and give it a clearly defined boundary. section 10.3.1
- Treat changes to the kernel as cross-team decisions requiring alignment. section 10.3.1
- Weigh consistency against autonomy, coordination overhead, and time to market. section 10.3.1
Figure 10.8 A shared kernel pattern. Four teams each own their own bounded context, but they share a model. Every time that model is affected, they need to talk to the other teams to change it.
Use the diagram to see how team-owned bounded contexts depend on one shared model and why changes require coordination. section 10.3.1
