SLIDE 1
Scaling Domain Driven Design
Greg Young IMIS
SLIDE 2 Presentation
Is Is Not
Discussion of DDD
being used in a large scale system
Discussion of concepts
that can be applied to
common infrastructure issues
A DDD Tutorial A Scalability Tutorial
SLIDE 3
Context
SLIDE 4
IMIS
Algorithmic Trading Regression Analysis Data Warehousing
SLIDE 5 Incoming Data
TSX / V
NYSE
Nasdaq
SLIDE 6
Challenges
Large Amounts of Complex Business Logic Large Amounts of Historical Data Large Amounts of Real-Time Data Nearly all Real-Time Data is Stateful Extremely Low Latency (< 100 ms)
SLIDE 7
DDD & Performant Systems
SLIDE 8
DDD Scalability
SLIDE 9
Bounded Contexts
Language Specialization Knowledge Hiding Team Partitioning Scalability??
SLIDE 10
Context Mapping
Bounded Context Anti- Corruption Layer Core Domain
SLIDE 11
Many Bounded Contexts do not need real time data…
SLIDE 12 First Attempt
Remote Facade Domain Analysis Async
SLIDE 13
Analysis
Pros Cons
Easily Scalable Simplicity “Retrofitability” Fractured Domain/
Duplicated Logic
Wrong Language Too Much Information
SLIDE 14
If things seem hard, there is something wrong with the model…
SLIDE 15
Are state changes domain concepts?
SLIDE 16 Changes are First Class Citizens
Customer CustomerAddressChangedMessage GetStateChanges()
SLIDE 17
Benefits
Explicit! Testing Auditing Optimism
SLIDE 18
Annoyances
Creating all of the messages (especially creates) Not easily applied to an existing domain
SLIDE 19
Reversed
Core Domain Anti- Corruption Layer Bounded Context
SLIDE 20
How to send the state changes?
All or most of the data is needed Reporting
Pipeline
Only a fraction of data is needed Many Smaller Systems
Pub/Sub
SLIDE 21 Reporting
Async Pipeline Domain Reporting Infrastructure
SLIDE 22 Warm/Hot Replication
Async Pipeline Domain Mirrorrer
SLIDE 23
Load Balancing w/ Optimistic Locking
Domain Mirrorrer
SLIDE 24 Striping (Partitioning)
Async Pipeline Domain Striper Locator
SLIDE 25
Summary
SLIDE 26
Summary
Bounded Contexts are Also for Scalability Most Context Mapping Need not be Synchronous State Changes are First Class Citizens
SLIDE 27
Questions