SlideShare a Scribd company logo
Domain-Driven Design
A Gentle Introduction into Challenging Topic
Asher Sterkin
asher.sterkin@gmail.com
Clean Code Meetup
January 2, AppsFlyer
About DDD IL
Asher SterkinVladik Khononov Erik Ashepa
● White belt circle: spread the word about DDD
● Black belt circle: apply DDD to real problems
Feel free to reach out if you want to join any of them
About Myself
● Software technologist/architect
● Almost 40 years in the field
● Former VP Technology @ NDS and Distinguished Engineer @ Cisco
● Currently CTO @ IRKI
● C-level mentoring on software strategy
● Cross-discipline approach (connecting the dots):
○ (Strategic) Domain-Driven Design
○ Serverless Architecture
○ Cynefin
○ Wardley Maps
○ Lean Startup
○ Promise Theory
○ ...
● Just an overview of the main DDD concepts
● All examples are purely illustrative
● No architectural or technological recommendations
● All wording is mine, as well as mistakes
Disclaimer
Domain-Driven Design is More Relevant than Ever
● Software infrastructure is rapidly commoditized
● Focus on delivering business value “yesterday”
● AI, AR, VR, 3DP, IoT, Blockchain spiral complexity up
● Need a practical method to keep complexity under control
● So far DDD has an unsurpassed record in this area
Domain-Driven Design Acronym
L
M
B
N
Pronounced LA-M-BA-N (invention is mine)
Domain-Driven Design at a Glance
Language
Model
Boundaries
Nesting
Language
● Common (ubiquitous) language for domain
and software experts
● Vocabulary reflected directly in software
● Normally a subset of domain-specific jargon
DDD is essentially a linguistic process
Model
• Language elements have meaning (semantics)
• Semantics is captured in a form of formal model:
– Object-Oriented
– Statecharts
– Functional
– Relational
– Graph
– Mathematical
– Neural Networks
– …
DDD is also a modeling process
Boundaries
● “One size fits all” models are impractical
● G-d like models result in Big Ball of Mud
● DDD insists on identifying multiple models:
○ Coherent within their own boundaries
○ Mapped onto others where
appropriate
DDD is about maintaining boundaries for- and mappings between- models
Example
SW? SW?
?
Example
SWHR SWFN
Employee, Salary, Bonus, ...
Nesting
● Boundaries exist at different levels of granularity
● Within DDD approach the following levels of granularity are considered:
○ Conceptual boundaries (sub-domains)
○ Application and Domain Services
○ Bounded Context
○ Stateless vs Stateful Elements
○ Aggregate
○ Entity
○ Value
● It’s possible to stop at any level and still have some value
● Not all parts of the system will be designed equally well!
Sub-domains
Generic Services
Supporting Services
Core
?
?
?
Sub-domains (popular version)
Generic Services
Supporting Services
Core
Needs to be done, but no advantage
Makes you money
3rd party products/services, no advantage
Example (my approach)
Generic Services
Supporting Services
Core
...
...
Green Invoice
push down
pull up
Generic for any domain
Common for group of domains
Essense of my business
Strategic Impact: build, buy, contribute
CDN
Application vs Domain Services (oversimplified)
users
things
robots
UI devices
Application Services Domain ServicesDDD is primarily focused on thisSome practitioners believe that
applying DDD here would be an
overkill, some others do not
IoT Device
Gateway
API Gateway
IoT Protocol
Gateway
API Gateway App Service
Domain Service
Domain Service
App Cache
App Service
App Service
Event Stream
Example
Clients App Services Domain Services
? ? ?
Textbook Example: Netflix API
App API App Services Domain API Domain API
Bounded Context
Bounded Context
Domain Model
Ubiquitous Language Nouns, Adjectives, Imperative Verbs, Interrogative Verbs, Perfect Tense
Verbs, Syntax, Grammar
Entities, Values, Commands, Queries, Events, Aggregates, Repository,
Computational Services, Factories, Anti-Corruption Layer, Saga
Bounded Context
Domain Model
Ubiquitous Language
context map
● Linguistic boundaries
● Reflect commitment to maintain strong cohesion inside and loose coupling outside
● Inside Bounded Context the model could evolve independently
● Defines a Minimal Meaningful scope with Maximum Acceptable Risk of not having semantic
consistency across different parts of the system (not too much, not too little)
Example
Bounded Context
?
Bounded Context
?
?
Example (my system at the moment)
Bounded Context
Front
Office
Bounded Context
Back Office
Bounded Context
Product
Design
Green Invoice
Stateless vs Stateful
Saga
Stateless
Computation
Stateful Object
Implements a multi-step
workflow. Needs state to
keep track of progress
and run compensating
transactions in the case of
failure
Stateful Objects introduced
when managing State is a part
of the Domain Service contract
Performs computation which does not
naturally fit into any stateful object. In
particular could be a Factory for some
Stateful Object with complex creation process
Example
Workflow
?
Stateless
Computation
?
Stateful Object
?
Example (mine)
Workflow
Product Item
Registration
Stateless
Computation
Resize
Picture
Product Catalog
Pictures
Product Types
Colors
Strong Transaction
Consistency + Invariant
DDD Aggregate and Repository
<<Aggregate Root>>
Entity
Entity Value
Value
Eventual
Transaction
Consistency
aggregate storage
store/retrieve requests -->
command/query requests -->
update/query method call -->
● Data integrity boundaries
● Reflects commitment to maintain strong transactional consistency
inside and eventual consistency outside
● Inner parts are accessible only via Aggregate Root
● Inside Aggregate some form of invariant is maintained
● Aggregates of the same type are stored within Repository
● Defines a Minimal Meaningful transactional scope with Maximum
Acceptable Risk level of not having immediate data consistency
across different parts of the system (not too much, not too little)
Command/query
Request Processor
Aggregate
Repository
Aggregate
DDD Entity, Value, Event, and Command
<<Aggregate Root>>
Entity
Entity Value
Value
Puts boundaries
around some identity,
which has state and
history
<<Aggregate Root>>
Entity
Ref
Value
Many Aggregates are
flat, but some have
nested Entities
Does not have identity or history. Encapsulates raw data types
(e.g. Integer, String) to supply meaningful names from
Ubiquitous Language (e.g. Street) including external references
to other Aggregates
Event
Something interesting
happened
Command
Way to send
an update
request to
Aggregate
Example
Event
?
<<Aggregate Root>>
?
Value
?
Command
?
Example (mine)
Tariff
Changed
<<Aggregate Root>>
ProductType
Tariff
Necklace
Bracelet
Earrings
...
Operation Beadwork
Clasp
...
Currency NIS
Change
Tariff
Advanced Topics not Covered Here
● Strategic DDD Patterns
● Context Mapping
● Command-Query Request Segregation (CQRS)
● Event Sourcing (ES)
● Dealing with Legacy Systems
● Event Storming
● DDD and Microservices (Erik’s talk)
● Cloud-native and Serverless DDD (area of my research)
● DDD and Machine/Deep Learning
● DDD and IoT
● DDD and VR/AR
● ...
DDD Bookshelf
DDD Video Library
● Eric Evans: Tackling Complexity in the Heart of Software
● Eric Evans: Good Design is Imperfect Design
● Eric Evans: DDD & Microservices: At Last, Some Boundaries!
● Eric Evans: Acknowledging CAP at the Root -- in the Domain Model
● Many, many more on YouTube and Vimeo
●
DDD Online
● Eric Evans’ site: https://domainlanguage.com/
● Domain-Driven Design on InfoQ: https://www.infoq.com/domain-driven-design
● Long curated list at https://github.com/heynickc/awesome-ddd
● Vladik’s Blog at http://vladikk.com/
●
A Shameless Promotion
Domain driven design:  a gentle introduction

More Related Content

What's hot

Event Driven Architecture
Event Driven ArchitectureEvent Driven Architecture
Event Driven Architecture
Stefan Norberg
 
Domain Driven Design (DDD)
Domain Driven Design (DDD)Domain Driven Design (DDD)
Domain Driven Design (DDD)
Tom Kocjan
 
Cloud Migration, Application Modernization, and Security
Cloud Migration, Application Modernization, and Security Cloud Migration, Application Modernization, and Security
Cloud Migration, Application Modernization, and Security
Tom Laszewski
 
Azure security and Compliance
Azure security and ComplianceAzure security and Compliance
Azure security and Compliance
Karina Matos
 
Clean Infrastructure as Code
Clean Infrastructure as Code Clean Infrastructure as Code
Clean Infrastructure as Code
QAware GmbH
 
Shaping serverless architecture with domain driven design patterns
Shaping serverless architecture with domain driven design patternsShaping serverless architecture with domain driven design patterns
Shaping serverless architecture with domain driven design patterns
Asher Sterkin
 
Introduction to Azure Data Lake
Introduction to Azure Data LakeIntroduction to Azure Data Lake
Introduction to Azure Data Lake
Antonios Chatzipavlis
 
Best Practices for Streaming IoT Data with MQTT and Apache Kafka
Best Practices for Streaming IoT Data with MQTT and Apache KafkaBest Practices for Streaming IoT Data with MQTT and Apache Kafka
Best Practices for Streaming IoT Data with MQTT and Apache Kafka
Kai Wähner
 
OCI Overview
OCI OverviewOCI Overview
OCI Overview
Kamil Wieczorek
 
Domain Driven Design(DDD) Presentation
Domain Driven Design(DDD) PresentationDomain Driven Design(DDD) Presentation
Domain Driven Design(DDD) Presentation
Oğuzhan Soykan
 
Domain Driven Design 101
Domain Driven Design 101Domain Driven Design 101
Domain Driven Design 101
Richard Dingwall
 
AWS for Backup and Recovery
AWS for Backup and RecoveryAWS for Backup and Recovery
AWS for Backup and Recovery
Amazon Web Services
 
Cloud Migration: Moving Data and Infrastructure to the Cloud
Cloud Migration: Moving Data and Infrastructure to the CloudCloud Migration: Moving Data and Infrastructure to the Cloud
Cloud Migration: Moving Data and Infrastructure to the Cloud
Safe Software
 
Introduction to Event-Driven Architecture
Introduction to Event-Driven Architecture Introduction to Event-Driven Architecture
Introduction to Event-Driven Architecture
Solace
 
Applying Domain-Driven Design to APIs and Microservices - Austin API Meetup
Applying Domain-Driven Design to APIs and Microservices  - Austin API MeetupApplying Domain-Driven Design to APIs and Microservices  - Austin API Meetup
Applying Domain-Driven Design to APIs and Microservices - Austin API Meetup
LaunchAny
 
Domain Driven Design Introduction
Domain Driven Design IntroductionDomain Driven Design Introduction
Domain Driven Design Introduction
wojtek_s
 
Introduction to AWS Storage Services
Introduction to AWS Storage ServicesIntroduction to AWS Storage Services
Introduction to AWS Storage Services
Amazon Web Services
 
Cost Optimisation on AWS
Cost Optimisation on AWSCost Optimisation on AWS
Cost Optimisation on AWS
Amazon Web Services
 
Developing event-driven microservices with event sourcing and CQRS (svcc, sv...
Developing event-driven microservices with event sourcing and CQRS  (svcc, sv...Developing event-driven microservices with event sourcing and CQRS  (svcc, sv...
Developing event-driven microservices with event sourcing and CQRS (svcc, sv...
Chris Richardson
 
Mainframe Modernization with Precisely and Microsoft Azure
Mainframe Modernization with Precisely and Microsoft AzureMainframe Modernization with Precisely and Microsoft Azure
Mainframe Modernization with Precisely and Microsoft Azure
Precisely
 

What's hot (20)

Event Driven Architecture
Event Driven ArchitectureEvent Driven Architecture
Event Driven Architecture
 
Domain Driven Design (DDD)
Domain Driven Design (DDD)Domain Driven Design (DDD)
Domain Driven Design (DDD)
 
Cloud Migration, Application Modernization, and Security
Cloud Migration, Application Modernization, and Security Cloud Migration, Application Modernization, and Security
Cloud Migration, Application Modernization, and Security
 
Azure security and Compliance
Azure security and ComplianceAzure security and Compliance
Azure security and Compliance
 
Clean Infrastructure as Code
Clean Infrastructure as Code Clean Infrastructure as Code
Clean Infrastructure as Code
 
Shaping serverless architecture with domain driven design patterns
Shaping serverless architecture with domain driven design patternsShaping serverless architecture with domain driven design patterns
Shaping serverless architecture with domain driven design patterns
 
Introduction to Azure Data Lake
Introduction to Azure Data LakeIntroduction to Azure Data Lake
Introduction to Azure Data Lake
 
Best Practices for Streaming IoT Data with MQTT and Apache Kafka
Best Practices for Streaming IoT Data with MQTT and Apache KafkaBest Practices for Streaming IoT Data with MQTT and Apache Kafka
Best Practices for Streaming IoT Data with MQTT and Apache Kafka
 
OCI Overview
OCI OverviewOCI Overview
OCI Overview
 
Domain Driven Design(DDD) Presentation
Domain Driven Design(DDD) PresentationDomain Driven Design(DDD) Presentation
Domain Driven Design(DDD) Presentation
 
Domain Driven Design 101
Domain Driven Design 101Domain Driven Design 101
Domain Driven Design 101
 
AWS for Backup and Recovery
AWS for Backup and RecoveryAWS for Backup and Recovery
AWS for Backup and Recovery
 
Cloud Migration: Moving Data and Infrastructure to the Cloud
Cloud Migration: Moving Data and Infrastructure to the CloudCloud Migration: Moving Data and Infrastructure to the Cloud
Cloud Migration: Moving Data and Infrastructure to the Cloud
 
Introduction to Event-Driven Architecture
Introduction to Event-Driven Architecture Introduction to Event-Driven Architecture
Introduction to Event-Driven Architecture
 
Applying Domain-Driven Design to APIs and Microservices - Austin API Meetup
Applying Domain-Driven Design to APIs and Microservices  - Austin API MeetupApplying Domain-Driven Design to APIs and Microservices  - Austin API Meetup
Applying Domain-Driven Design to APIs and Microservices - Austin API Meetup
 
Domain Driven Design Introduction
Domain Driven Design IntroductionDomain Driven Design Introduction
Domain Driven Design Introduction
 
Introduction to AWS Storage Services
Introduction to AWS Storage ServicesIntroduction to AWS Storage Services
Introduction to AWS Storage Services
 
Cost Optimisation on AWS
Cost Optimisation on AWSCost Optimisation on AWS
Cost Optimisation on AWS
 
Developing event-driven microservices with event sourcing and CQRS (svcc, sv...
Developing event-driven microservices with event sourcing and CQRS  (svcc, sv...Developing event-driven microservices with event sourcing and CQRS  (svcc, sv...
Developing event-driven microservices with event sourcing and CQRS (svcc, sv...
 
Mainframe Modernization with Precisely and Microsoft Azure
Mainframe Modernization with Precisely and Microsoft AzureMainframe Modernization with Precisely and Microsoft Azure
Mainframe Modernization with Precisely and Microsoft Azure
 

Similar to Domain driven design: a gentle introduction

Developing cloud serverless components in Python: DDD Perspective
Developing cloud serverless components in Python: DDD PerspectiveDeveloping cloud serverless components in Python: DDD Perspective
Developing cloud serverless components in Python: DDD Perspective
Asher Sterkin
 
Microservices as an evolutionary architecture: lessons learned
Microservices as an evolutionary architecture: lessons learnedMicroservices as an evolutionary architecture: lessons learned
Microservices as an evolutionary architecture: lessons learned
Luram Archanjo
 
From class to architecture
From class to architectureFrom class to architecture
From class to architecture
Marcin Hawraniak
 
Applying Domain-Driven Design to craft Rich Domain Models
Applying Domain-Driven Design to craft Rich Domain ModelsApplying Domain-Driven Design to craft Rich Domain Models
Applying Domain-Driven Design to craft Rich Domain Models
Alexander van Trijffel
 
Brownfield Domain Driven Design
Brownfield Domain Driven DesignBrownfield Domain Driven Design
Brownfield Domain Driven Design
Nicolò Pignatelli
 
Canadian Experts Discuss Modern Data Stacks and Cloud Computing for 5 Years o...
Canadian Experts Discuss Modern Data Stacks and Cloud Computing for 5 Years o...Canadian Experts Discuss Modern Data Stacks and Cloud Computing for 5 Years o...
Canadian Experts Discuss Modern Data Stacks and Cloud Computing for 5 Years o...
Daniel Zivkovic
 
Domain Driven Design
Domain Driven DesignDomain Driven Design
Domain Driven Design
Muhammad Ali
 
Which Questions We Should Have
Which Questions We Should HaveWhich Questions We Should Have
Which Questions We Should Have
Oracle Korea
 
Shaping serverless architecture with domain driven design patterns
Shaping serverless architecture with domain driven design patternsShaping serverless architecture with domain driven design patterns
Shaping serverless architecture with domain driven design patterns
Shimon Tolts
 
D2 domain driven-design
D2 domain driven-designD2 domain driven-design
D2 domain driven-design
Arnaud Bouchez
 
Domain Driven Design
Domain Driven DesignDomain Driven Design
Domain Driven Design
Ryan Riley
 
Clean architecture
Clean architectureClean architecture
Clean architecture
.NET Crowd
 
Modelling a complex domain with Domain-Driven Design
Modelling a complex domain with Domain-Driven DesignModelling a complex domain with Domain-Driven Design
Modelling a complex domain with Domain-Driven Design
Naeem Sarfraz
 
Idiomatic Domain Driven Design: implementing CQRS
Idiomatic Domain Driven Design: implementing CQRSIdiomatic Domain Driven Design: implementing CQRS
Idiomatic Domain Driven Design: implementing CQRS
Andrea Saltarello
 
An Introduction to Domain Driven Design in PHP
An Introduction to Domain Driven Design in PHPAn Introduction to Domain Driven Design in PHP
An Introduction to Domain Driven Design in PHP
Chris Renner
 
Domain-Driven Design
Domain-Driven DesignDomain-Driven Design
Domain-Driven Design
Geeks Anonymes
 
Domain Driven Design & Hexagonal Architecture
Domain Driven Design & Hexagonal ArchitectureDomain Driven Design & Hexagonal Architecture
Domain Driven Design & Hexagonal Architecture
Can Pekdemir
 
AWS Techniques and lessons writing a minimal cost gitlab runner
AWS Techniques and lessons writing a minimal cost gitlab runnerAWS Techniques and lessons writing a minimal cost gitlab runner
AWS Techniques and lessons writing a minimal cost gitlab runner
Anthony Scata
 
Domain Driven Design
Domain Driven DesignDomain Driven Design
Domain Driven Design
Up2 Technology
 
Architecturing the software stack at a small business
Architecturing the software stack at a small businessArchitecturing the software stack at a small business
Architecturing the software stack at a small business
YangJerng Hwa
 

Similar to Domain driven design: a gentle introduction (20)

Developing cloud serverless components in Python: DDD Perspective
Developing cloud serverless components in Python: DDD PerspectiveDeveloping cloud serverless components in Python: DDD Perspective
Developing cloud serverless components in Python: DDD Perspective
 
Microservices as an evolutionary architecture: lessons learned
Microservices as an evolutionary architecture: lessons learnedMicroservices as an evolutionary architecture: lessons learned
Microservices as an evolutionary architecture: lessons learned
 
From class to architecture
From class to architectureFrom class to architecture
From class to architecture
 
Applying Domain-Driven Design to craft Rich Domain Models
Applying Domain-Driven Design to craft Rich Domain ModelsApplying Domain-Driven Design to craft Rich Domain Models
Applying Domain-Driven Design to craft Rich Domain Models
 
Brownfield Domain Driven Design
Brownfield Domain Driven DesignBrownfield Domain Driven Design
Brownfield Domain Driven Design
 
Canadian Experts Discuss Modern Data Stacks and Cloud Computing for 5 Years o...
Canadian Experts Discuss Modern Data Stacks and Cloud Computing for 5 Years o...Canadian Experts Discuss Modern Data Stacks and Cloud Computing for 5 Years o...
Canadian Experts Discuss Modern Data Stacks and Cloud Computing for 5 Years o...
 
Domain Driven Design
Domain Driven DesignDomain Driven Design
Domain Driven Design
 
Which Questions We Should Have
Which Questions We Should HaveWhich Questions We Should Have
Which Questions We Should Have
 
Shaping serverless architecture with domain driven design patterns
Shaping serverless architecture with domain driven design patternsShaping serverless architecture with domain driven design patterns
Shaping serverless architecture with domain driven design patterns
 
D2 domain driven-design
D2 domain driven-designD2 domain driven-design
D2 domain driven-design
 
Domain Driven Design
Domain Driven DesignDomain Driven Design
Domain Driven Design
 
Clean architecture
Clean architectureClean architecture
Clean architecture
 
Modelling a complex domain with Domain-Driven Design
Modelling a complex domain with Domain-Driven DesignModelling a complex domain with Domain-Driven Design
Modelling a complex domain with Domain-Driven Design
 
Idiomatic Domain Driven Design: implementing CQRS
Idiomatic Domain Driven Design: implementing CQRSIdiomatic Domain Driven Design: implementing CQRS
Idiomatic Domain Driven Design: implementing CQRS
 
An Introduction to Domain Driven Design in PHP
An Introduction to Domain Driven Design in PHPAn Introduction to Domain Driven Design in PHP
An Introduction to Domain Driven Design in PHP
 
Domain-Driven Design
Domain-Driven DesignDomain-Driven Design
Domain-Driven Design
 
Domain Driven Design & Hexagonal Architecture
Domain Driven Design & Hexagonal ArchitectureDomain Driven Design & Hexagonal Architecture
Domain Driven Design & Hexagonal Architecture
 
AWS Techniques and lessons writing a minimal cost gitlab runner
AWS Techniques and lessons writing a minimal cost gitlab runnerAWS Techniques and lessons writing a minimal cost gitlab runner
AWS Techniques and lessons writing a minimal cost gitlab runner
 
Domain Driven Design
Domain Driven DesignDomain Driven Design
Domain Driven Design
 
Architecturing the software stack at a small business
Architecturing the software stack at a small businessArchitecturing the software stack at a small business
Architecturing the software stack at a small business
 

More from Asher Sterkin

Essence of Requirements Engineering: Pragmatic Insights for 2024
Essence of Requirements Engineering: Pragmatic Insights for 2024Essence of Requirements Engineering: Pragmatic Insights for 2024
Essence of Requirements Engineering: Pragmatic Insights for 2024
Asher Sterkin
 
Cloud Infrastructure from Python Code: PyCon DE-23
Cloud Infrastructure from Python Code: PyCon DE-23Cloud Infrastructure from Python Code: PyCon DE-23
Cloud Infrastructure from Python Code: PyCon DE-23
Asher Sterkin
 
PyCascades-23.pdf
PyCascades-23.pdfPyCascades-23.pdf
PyCascades-23.pdf
Asher Sterkin
 
PyConFR-23 Talk.pdf
PyConFR-23 Talk.pdfPyConFR-23 Talk.pdf
PyConFR-23 Talk.pdf
Asher Sterkin
 
pyjamas22_ generic composite in python.pdf
pyjamas22_ generic composite in python.pdfpyjamas22_ generic composite in python.pdf
pyjamas22_ generic composite in python.pdf
Asher Sterkin
 
If your computer is cloud what its Operating System look like?
If your computer is cloud what its Operating System look like?If your computer is cloud what its Operating System look like?
If your computer is cloud what its Operating System look like?
Asher Sterkin
 
Serverless flow programming a new perspective (py web meetup, sept 2nd, 2019...
Serverless flow programming  a new perspective (py web meetup, sept 2nd, 2019...Serverless flow programming  a new perspective (py web meetup, sept 2nd, 2019...
Serverless flow programming a new perspective (py web meetup, sept 2nd, 2019...
Asher Sterkin
 
Documenting serverless architectures could we do it better - o'reily sa con...
Documenting serverless architectures  could we do it better  - o'reily sa con...Documenting serverless architectures  could we do it better  - o'reily sa con...
Documenting serverless architectures could we do it better - o'reily sa con...
Asher Sterkin
 
Shaping serverless architecture with domain driven design patterns - py web-il
Shaping serverless architecture with domain driven design patterns - py web-ilShaping serverless architecture with domain driven design patterns - py web-il
Shaping serverless architecture with domain driven design patterns - py web-il
Asher Sterkin
 
Strategy toolbox for startsups
Strategy toolbox for startsupsStrategy toolbox for startsups
Strategy toolbox for startsups
Asher Sterkin
 
AI as a service
AI as a serviceAI as a service
AI as a service
Asher Sterkin
 
Serverless ddd
Serverless dddServerless ddd
Serverless ddd
Asher Sterkin
 
Software strategy for startups
Software strategy for startupsSoftware strategy for startups
Software strategy for startups
Asher Sterkin
 
What is exactly anti fragile in dev ops - v3
What is exactly anti fragile in dev ops - v3What is exactly anti fragile in dev ops - v3
What is exactly anti fragile in dev ops - v3Asher Sterkin
 

More from Asher Sterkin (14)

Essence of Requirements Engineering: Pragmatic Insights for 2024
Essence of Requirements Engineering: Pragmatic Insights for 2024Essence of Requirements Engineering: Pragmatic Insights for 2024
Essence of Requirements Engineering: Pragmatic Insights for 2024
 
Cloud Infrastructure from Python Code: PyCon DE-23
Cloud Infrastructure from Python Code: PyCon DE-23Cloud Infrastructure from Python Code: PyCon DE-23
Cloud Infrastructure from Python Code: PyCon DE-23
 
PyCascades-23.pdf
PyCascades-23.pdfPyCascades-23.pdf
PyCascades-23.pdf
 
PyConFR-23 Talk.pdf
PyConFR-23 Talk.pdfPyConFR-23 Talk.pdf
PyConFR-23 Talk.pdf
 
pyjamas22_ generic composite in python.pdf
pyjamas22_ generic composite in python.pdfpyjamas22_ generic composite in python.pdf
pyjamas22_ generic composite in python.pdf
 
If your computer is cloud what its Operating System look like?
If your computer is cloud what its Operating System look like?If your computer is cloud what its Operating System look like?
If your computer is cloud what its Operating System look like?
 
Serverless flow programming a new perspective (py web meetup, sept 2nd, 2019...
Serverless flow programming  a new perspective (py web meetup, sept 2nd, 2019...Serverless flow programming  a new perspective (py web meetup, sept 2nd, 2019...
Serverless flow programming a new perspective (py web meetup, sept 2nd, 2019...
 
Documenting serverless architectures could we do it better - o'reily sa con...
Documenting serverless architectures  could we do it better  - o'reily sa con...Documenting serverless architectures  could we do it better  - o'reily sa con...
Documenting serverless architectures could we do it better - o'reily sa con...
 
Shaping serverless architecture with domain driven design patterns - py web-il
Shaping serverless architecture with domain driven design patterns - py web-ilShaping serverless architecture with domain driven design patterns - py web-il
Shaping serverless architecture with domain driven design patterns - py web-il
 
Strategy toolbox for startsups
Strategy toolbox for startsupsStrategy toolbox for startsups
Strategy toolbox for startsups
 
AI as a service
AI as a serviceAI as a service
AI as a service
 
Serverless ddd
Serverless dddServerless ddd
Serverless ddd
 
Software strategy for startups
Software strategy for startupsSoftware strategy for startups
Software strategy for startups
 
What is exactly anti fragile in dev ops - v3
What is exactly anti fragile in dev ops - v3What is exactly anti fragile in dev ops - v3
What is exactly anti fragile in dev ops - v3
 

Recently uploaded

Prosigns: Transforming Business with Tailored Technology Solutions
Prosigns: Transforming Business with Tailored Technology SolutionsProsigns: Transforming Business with Tailored Technology Solutions
Prosigns: Transforming Business with Tailored Technology Solutions
Prosigns
 
Enhancing Research Orchestration Capabilities at ORNL.pdf
Enhancing Research Orchestration Capabilities at ORNL.pdfEnhancing Research Orchestration Capabilities at ORNL.pdf
Enhancing Research Orchestration Capabilities at ORNL.pdf
Globus
 
2024 RoOUG Security model for the cloud.pptx
2024 RoOUG Security model for the cloud.pptx2024 RoOUG Security model for the cloud.pptx
2024 RoOUG Security model for the cloud.pptx
Georgi Kodinov
 
Large Language Models and the End of Programming
Large Language Models and the End of ProgrammingLarge Language Models and the End of Programming
Large Language Models and the End of Programming
Matt Welsh
 
Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024
Globus
 
Enterprise Software Development with No Code Solutions.pptx
Enterprise Software Development with No Code Solutions.pptxEnterprise Software Development with No Code Solutions.pptx
Enterprise Software Development with No Code Solutions.pptx
QuickwayInfoSystems3
 
AI Pilot Review: The World’s First Virtual Assistant Marketing Suite
AI Pilot Review: The World’s First Virtual Assistant Marketing SuiteAI Pilot Review: The World’s First Virtual Assistant Marketing Suite
AI Pilot Review: The World’s First Virtual Assistant Marketing Suite
Google
 
GlobusWorld 2024 Opening Keynote session
GlobusWorld 2024 Opening Keynote sessionGlobusWorld 2024 Opening Keynote session
GlobusWorld 2024 Opening Keynote session
Globus
 
Quarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden ExtensionsQuarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden Extensions
Max Andersen
 
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoamOpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
takuyayamamoto1800
 
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Globus
 
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
Shahin Sheidaei
 
APIs for Browser Automation (MoT Meetup 2024)
APIs for Browser Automation (MoT Meetup 2024)APIs for Browser Automation (MoT Meetup 2024)
APIs for Browser Automation (MoT Meetup 2024)
Boni García
 
A Sighting of filterA in Typelevel Rite of Passage
A Sighting of filterA in Typelevel Rite of PassageA Sighting of filterA in Typelevel Rite of Passage
A Sighting of filterA in Typelevel Rite of Passage
Philip Schwarz
 
Understanding Globus Data Transfers with NetSage
Understanding Globus Data Transfers with NetSageUnderstanding Globus Data Transfers with NetSage
Understanding Globus Data Transfers with NetSage
Globus
 
Enterprise Resource Planning System in Telangana
Enterprise Resource Planning System in TelanganaEnterprise Resource Planning System in Telangana
Enterprise Resource Planning System in Telangana
NYGGS Automation Suite
 
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.ILBeyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Natan Silnitsky
 
Vitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume MontevideoVitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume Montevideo
Vitthal Shirke
 
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Globus
 
Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus
 

Recently uploaded (20)

Prosigns: Transforming Business with Tailored Technology Solutions
Prosigns: Transforming Business with Tailored Technology SolutionsProsigns: Transforming Business with Tailored Technology Solutions
Prosigns: Transforming Business with Tailored Technology Solutions
 
Enhancing Research Orchestration Capabilities at ORNL.pdf
Enhancing Research Orchestration Capabilities at ORNL.pdfEnhancing Research Orchestration Capabilities at ORNL.pdf
Enhancing Research Orchestration Capabilities at ORNL.pdf
 
2024 RoOUG Security model for the cloud.pptx
2024 RoOUG Security model for the cloud.pptx2024 RoOUG Security model for the cloud.pptx
2024 RoOUG Security model for the cloud.pptx
 
Large Language Models and the End of Programming
Large Language Models and the End of ProgrammingLarge Language Models and the End of Programming
Large Language Models and the End of Programming
 
Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024
 
Enterprise Software Development with No Code Solutions.pptx
Enterprise Software Development with No Code Solutions.pptxEnterprise Software Development with No Code Solutions.pptx
Enterprise Software Development with No Code Solutions.pptx
 
AI Pilot Review: The World’s First Virtual Assistant Marketing Suite
AI Pilot Review: The World’s First Virtual Assistant Marketing SuiteAI Pilot Review: The World’s First Virtual Assistant Marketing Suite
AI Pilot Review: The World’s First Virtual Assistant Marketing Suite
 
GlobusWorld 2024 Opening Keynote session
GlobusWorld 2024 Opening Keynote sessionGlobusWorld 2024 Opening Keynote session
GlobusWorld 2024 Opening Keynote session
 
Quarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden ExtensionsQuarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden Extensions
 
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoamOpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
 
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
 
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
 
APIs for Browser Automation (MoT Meetup 2024)
APIs for Browser Automation (MoT Meetup 2024)APIs for Browser Automation (MoT Meetup 2024)
APIs for Browser Automation (MoT Meetup 2024)
 
A Sighting of filterA in Typelevel Rite of Passage
A Sighting of filterA in Typelevel Rite of PassageA Sighting of filterA in Typelevel Rite of Passage
A Sighting of filterA in Typelevel Rite of Passage
 
Understanding Globus Data Transfers with NetSage
Understanding Globus Data Transfers with NetSageUnderstanding Globus Data Transfers with NetSage
Understanding Globus Data Transfers with NetSage
 
Enterprise Resource Planning System in Telangana
Enterprise Resource Planning System in TelanganaEnterprise Resource Planning System in Telangana
Enterprise Resource Planning System in Telangana
 
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.ILBeyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
 
Vitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume MontevideoVitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume Montevideo
 
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
 
Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024
 

Domain driven design: a gentle introduction

  • 1. Domain-Driven Design A Gentle Introduction into Challenging Topic Asher Sterkin asher.sterkin@gmail.com Clean Code Meetup January 2, AppsFlyer
  • 2. About DDD IL Asher SterkinVladik Khononov Erik Ashepa ● White belt circle: spread the word about DDD ● Black belt circle: apply DDD to real problems Feel free to reach out if you want to join any of them
  • 3. About Myself ● Software technologist/architect ● Almost 40 years in the field ● Former VP Technology @ NDS and Distinguished Engineer @ Cisco ● Currently CTO @ IRKI ● C-level mentoring on software strategy ● Cross-discipline approach (connecting the dots): ○ (Strategic) Domain-Driven Design ○ Serverless Architecture ○ Cynefin ○ Wardley Maps ○ Lean Startup ○ Promise Theory ○ ...
  • 4. ● Just an overview of the main DDD concepts ● All examples are purely illustrative ● No architectural or technological recommendations ● All wording is mine, as well as mistakes Disclaimer
  • 5. Domain-Driven Design is More Relevant than Ever ● Software infrastructure is rapidly commoditized ● Focus on delivering business value “yesterday” ● AI, AR, VR, 3DP, IoT, Blockchain spiral complexity up ● Need a practical method to keep complexity under control ● So far DDD has an unsurpassed record in this area
  • 6. Domain-Driven Design Acronym L M B N Pronounced LA-M-BA-N (invention is mine)
  • 7. Domain-Driven Design at a Glance Language Model Boundaries Nesting
  • 8. Language ● Common (ubiquitous) language for domain and software experts ● Vocabulary reflected directly in software ● Normally a subset of domain-specific jargon DDD is essentially a linguistic process
  • 9. Model • Language elements have meaning (semantics) • Semantics is captured in a form of formal model: – Object-Oriented – Statecharts – Functional – Relational – Graph – Mathematical – Neural Networks – … DDD is also a modeling process
  • 10. Boundaries ● “One size fits all” models are impractical ● G-d like models result in Big Ball of Mud ● DDD insists on identifying multiple models: ○ Coherent within their own boundaries ○ Mapped onto others where appropriate DDD is about maintaining boundaries for- and mappings between- models
  • 13. Nesting ● Boundaries exist at different levels of granularity ● Within DDD approach the following levels of granularity are considered: ○ Conceptual boundaries (sub-domains) ○ Application and Domain Services ○ Bounded Context ○ Stateless vs Stateful Elements ○ Aggregate ○ Entity ○ Value ● It’s possible to stop at any level and still have some value ● Not all parts of the system will be designed equally well!
  • 15. Sub-domains (popular version) Generic Services Supporting Services Core Needs to be done, but no advantage Makes you money 3rd party products/services, no advantage
  • 16. Example (my approach) Generic Services Supporting Services Core ... ... Green Invoice push down pull up Generic for any domain Common for group of domains Essense of my business Strategic Impact: build, buy, contribute
  • 17. CDN Application vs Domain Services (oversimplified) users things robots UI devices Application Services Domain ServicesDDD is primarily focused on thisSome practitioners believe that applying DDD here would be an overkill, some others do not IoT Device Gateway API Gateway IoT Protocol Gateway API Gateway App Service Domain Service Domain Service App Cache App Service App Service Event Stream
  • 18. Example Clients App Services Domain Services ? ? ?
  • 19. Textbook Example: Netflix API App API App Services Domain API Domain API
  • 20. Bounded Context Bounded Context Domain Model Ubiquitous Language Nouns, Adjectives, Imperative Verbs, Interrogative Verbs, Perfect Tense Verbs, Syntax, Grammar Entities, Values, Commands, Queries, Events, Aggregates, Repository, Computational Services, Factories, Anti-Corruption Layer, Saga Bounded Context Domain Model Ubiquitous Language context map ● Linguistic boundaries ● Reflect commitment to maintain strong cohesion inside and loose coupling outside ● Inside Bounded Context the model could evolve independently ● Defines a Minimal Meaningful scope with Maximum Acceptable Risk of not having semantic consistency across different parts of the system (not too much, not too little)
  • 22. Example (my system at the moment) Bounded Context Front Office Bounded Context Back Office Bounded Context Product Design Green Invoice
  • 23. Stateless vs Stateful Saga Stateless Computation Stateful Object Implements a multi-step workflow. Needs state to keep track of progress and run compensating transactions in the case of failure Stateful Objects introduced when managing State is a part of the Domain Service contract Performs computation which does not naturally fit into any stateful object. In particular could be a Factory for some Stateful Object with complex creation process
  • 26. Strong Transaction Consistency + Invariant DDD Aggregate and Repository <<Aggregate Root>> Entity Entity Value Value Eventual Transaction Consistency aggregate storage store/retrieve requests --> command/query requests --> update/query method call --> ● Data integrity boundaries ● Reflects commitment to maintain strong transactional consistency inside and eventual consistency outside ● Inner parts are accessible only via Aggregate Root ● Inside Aggregate some form of invariant is maintained ● Aggregates of the same type are stored within Repository ● Defines a Minimal Meaningful transactional scope with Maximum Acceptable Risk level of not having immediate data consistency across different parts of the system (not too much, not too little) Command/query Request Processor Aggregate Repository Aggregate
  • 27. DDD Entity, Value, Event, and Command <<Aggregate Root>> Entity Entity Value Value Puts boundaries around some identity, which has state and history <<Aggregate Root>> Entity Ref Value Many Aggregates are flat, but some have nested Entities Does not have identity or history. Encapsulates raw data types (e.g. Integer, String) to supply meaningful names from Ubiquitous Language (e.g. Street) including external references to other Aggregates Event Something interesting happened Command Way to send an update request to Aggregate
  • 30. Advanced Topics not Covered Here ● Strategic DDD Patterns ● Context Mapping ● Command-Query Request Segregation (CQRS) ● Event Sourcing (ES) ● Dealing with Legacy Systems ● Event Storming ● DDD and Microservices (Erik’s talk) ● Cloud-native and Serverless DDD (area of my research) ● DDD and Machine/Deep Learning ● DDD and IoT ● DDD and VR/AR ● ...
  • 32. DDD Video Library ● Eric Evans: Tackling Complexity in the Heart of Software ● Eric Evans: Good Design is Imperfect Design ● Eric Evans: DDD & Microservices: At Last, Some Boundaries! ● Eric Evans: Acknowledging CAP at the Root -- in the Domain Model ● Many, many more on YouTube and Vimeo ●
  • 33. DDD Online ● Eric Evans’ site: https://domainlanguage.com/ ● Domain-Driven Design on InfoQ: https://www.infoq.com/domain-driven-design ● Long curated list at https://github.com/heynickc/awesome-ddd ● Vladik’s Blog at http://vladikk.com/ ●