Core Idea

The Data Domain Pattern allows multiple services to share database ownership of common schema elements (tables, schemas) within a bounded context while maintaining joint responsibility for data integrity and evolution. It trades implementation simplicity for managed coupling.

Definition

The Data Domain Pattern allows multiple related services to share access to common database schema elements within the same bounded context. Unlike strict “database per service” isolation, it recognizes that services with high semantic cohesion may benefit from shared data structures when properly governed.

Key Characteristics

  • Shared schema ownership: Multiple services jointly own tables or schemas within a bounded context, requiring coordinated schema evolution but enabling simpler data access and atomic transactions
  • Bounded context alignment: Services sharing data must belong to the same domain boundary—sharing across bounded context boundaries is strongly discouraged
  • Development-time coupling: Schema changes require coordination among all services accessing the schema, creating team dependencies
  • Runtime coupling potential: Long-running transactions can block other services accessing shared tables
  • ACID transaction simplification: Transactions spanning entities remain local and atomic, avoiding distributed transaction complexity
  • Incremental migration enabler: Used as an intermediate step when decomposing monoliths

Why It Matters

The Data Domain Pattern represents pragmatic architecture acknowledging that not all distributed problems need identical solutions:

  • Simplicity over purity: Avoids complex distributed data patterns when services genuinely share a semantic domain
  • Transaction consistency: Provides ACID guarantees that are architecturally complex in fully distributed systems
  • Bounded context enforcement: Restricts sharing within contexts, preventing enterprise-wide shared database anti-patterns

The primary risk is that shared schemas make independent scaling of each service’s data tier harder and introduce a shared single point of failure.

Sources

Note

This content was drafted with assistance from AI tools for research, organization, and initial content generation. All final content has been reviewed, fact-checked, and edited by the author to ensure accuracy and alignment with the author’s intentions and perspective.