SlideShare a Scribd company logo
Modularity by Microservices
Tech Festival #INGLovesIT
How can DDD help in decomposing applications in microservices?
Bucharest, 7th of April 2017
,
Agenda
2
What are microservices?
Whats is DDD? Introduction to the most important DDD patterns
Microservices revisited
Conclusions: Design Rules
What are microservices?
Source: https://www.martinfowler.com/bliki/MicroservicePrerequisites.html
3
Microservices characteristics*
 Componentization via Services
 Organized around Business Capabilities
 Products not Projects
 Smart endpoints and dumb pipes
 Decentralized Governance
 Decentralized Data Management
 Infrastructure Automation
 Design for failure
 Evolutionary Design
*Reference: https://martinfowler.com/articles/microservices.html
4
Microservices benefits
 Agility in development
 Better understanding of the architecture
 Resilience in a production
 Independent scalability of microservices
 Independent deployment of microservices
 Fault tolerance (failures in a microservice can be isolated from other microservices)
5
Levels of abstractions
6
microservices
modules
packages
classes
The same concerns (high cohesion, low coupling, separation of concerns etc.) apply at all levels.
“If people can’t build monoliths properly, microservices won’t help.”
Simon Brown
From monolith to microservices
7
Problem #1:
Data Services as Microservices
 Layered Coupling
 Communication Coupling
The service is not autonomous
8
Problem #2:
Synchronous Integration between Microservices
 Temporal Coupling
 Behavioral Coupling*
The services are not autonomous
Complex and unreliable
compensation logic
Circuit breaker, timeouts, retries
etc. are of limited use
*Reference: http://iansrobinson.com/2009/04/27/temporal-and-behavioural-coupling/
9
How do we identify microservices?
10
Introduction to DDD
 Strategic Design:
 bounded contexts
 context map
 Tactical Design:
 entities
 values
 aggregates
 aggregate roots
 Repositories
 services
 domain events
 application services
11
Reference: Evans, Eric. Domain-Driven Design: Tackling Complexity in the Heart of Software. Boston: Addison-Wesley, 2003, Vernon, Vaughn. Implementing Domain-Driven Design. Boston: Addison-
Wesley, 2013.
Aggregate Design Rules
 Cluster entities into aggregates according to the invariants that really need to be
guaranteed
 Reference other aggregates only by root id (including ones from the same bounded
context)
 Limit aggregates to small set of data
 Modify in one transaction only one aggregate instance
12
Domain Events
 An event captures the changes in the state of a single aggregate
 Events are immutable
 They get published by the aggregates and contain the associated aggregate root id
 Each event should have a unique id that could be used for de-duplication
13
Integration Rules between Bounded Contexts
 Via a publish/subscriber messaging infrastructure
 The bounded contexts interested in the data maintained by other bounded
contexts subscribe to the relevant events
 Integration via events is applicable also between different aggregate instances from
the same bounded context
 Transactional Consistency within aggregate boundaries
 Eventual Consistency between different bounded contexts and between different
aggregate instances
14
Aggregate Processing
15
Messaging Requirements in View of DDD
 Support for publish/subscriber pattern
 Support for competing consumers pattern
 Persistence and Durability
 At-least-once message delivery
 Partial message ordering (per aggregate)
16
Application Technical Requirements in View of DDD
 Transactional semantics when publishing events
 Events deduplication on subscriber-side for achieving exactly-once delivery
semantics
17
Transactional Messaging.
Solution #1
18
Transactional Messaging.
Solution #2
19
Packaging
20
 Separation of business concerns from technological concerns
 Apply Dependency Inversion Principle at domain boundaries
Back to microservices
21
Microservices Design Rules
 1 microservice = 1 bounded context = 1 deployment unit
 1 operation = 1 transaction = 1 aggregate
 Prefer asynchronous communication between microservices over synchronous
request/reply integration  data replication over events
 Transactional consistency within a microservice / Eventual consistency between
microservices
22
Microservices Architecture
Decomposing application into loosely
coupled services:
- Explicit contract/ interface
- Boundary alignment with
business capabilities
- Asynchronous communication
between microservices
- Microservices have their own
storage (they are the
authoritative source of data for
their domain)
1
2
3
4
1
2
3
4
23
Microservices Benefits
 Agility in development
 Resilience in production
 Microservices can be scaled independently
 Data Scalability (Data Partitioning)
 Microservices can be deployed independently (different deployment options should
be made available by the architecture).
 Failures in a microservice can be isolated from other microservices
24
Conclusions
 Microservices are mainly about design and only secondarily about technology
 Domain Driven Design offers essential lessons on:
 how to modularize your application in microservices
 how to achieve resilience
 how to achieve scalability
25
Thank you!

More Related Content

PDF
Implementing Domain Events with Kafka
PDF
Distributed Systems for Blockchain using Cloud
PPTX
Monolithic - Microservice Architecture
PDF
What Is Solution Architecture? The Black Art Of I/T Solution Architecture
PPTX
Microservice intro
PDF
Hyperledger arch wg_paper_1_consensus
PDF
Third Party Cloud Management
PDF
Distributed Ledger Technology
Implementing Domain Events with Kafka
Distributed Systems for Blockchain using Cloud
Monolithic - Microservice Architecture
What Is Solution Architecture? The Black Art Of I/T Solution Architecture
Microservice intro
Hyperledger arch wg_paper_1_consensus
Third Party Cloud Management
Distributed Ledger Technology

What's hot (20)

PDF
Enterprise Integration in Cloud Native Microservices Architectures
PDF
[한국핀테크포럼] 제7회 핀테크포럼
PPTX
Cloud proposition for banking
PDF
Road to Microservices
PPT
Data Intensive Services
PPT
Design Principles for a Service-Aware Future Internet
PDF
Is Azure Blockchain Cloud the Future of Cloud Computing | Sysfore
DOCX
Collaboration in multicloud computing environments framework and security issues
DOCX
DOTNET 2013 IEEE CLOUDCOMPUTING PROJECT Collaboration in multicloud computing...
PPTX
Engage 2018 - What About the Apps? A Domino Modernisation Story
PPTX
Blockchain: The New Technology of Trust
PDF
Connecting the Dots: How Blockchains Can Interoperate with Polkadot
PDF
APIdays Paris 2019 - Cloud native API Management for Microservices on a Servi...
PDF
Cloud Customer Architecture for Blockchain
PDF
Blockchin architecture & use cases -part-2
PDF
Mobile gis
PPTX
Domain Driven Development (DDD)
PPTX
Microservices Architecture
PPTX
Anatomy of a hyperledger application
PPTX
The Cloud is dead ?! Blockchain in the new cloud
Enterprise Integration in Cloud Native Microservices Architectures
[한국핀테크포럼] 제7회 핀테크포럼
Cloud proposition for banking
Road to Microservices
Data Intensive Services
Design Principles for a Service-Aware Future Internet
Is Azure Blockchain Cloud the Future of Cloud Computing | Sysfore
Collaboration in multicloud computing environments framework and security issues
DOTNET 2013 IEEE CLOUDCOMPUTING PROJECT Collaboration in multicloud computing...
Engage 2018 - What About the Apps? A Domino Modernisation Story
Blockchain: The New Technology of Trust
Connecting the Dots: How Blockchains Can Interoperate with Polkadot
APIdays Paris 2019 - Cloud native API Management for Microservices on a Servi...
Cloud Customer Architecture for Blockchain
Blockchin architecture & use cases -part-2
Mobile gis
Domain Driven Development (DDD)
Microservices Architecture
Anatomy of a hyperledger application
The Cloud is dead ?! Blockchain in the new cloud
Ad

Similar to Modularity by Microservices (20)

PDF
Pitfalls & Challenges Faced During a Microservices Architecture Implementation
PDF
Micro services Architecture with Vortex -- Part I
PDF
Comprehensive Study on Deployment Models and Service Models in Cloud Computing.
PDF
Building a High-Performance Reactive Microservices Architecture
PDF
1213532535.pdf
PDF
SELECTION MECHANISM OF MICRO-SERVICES ORCHESTRATION VS. CHOREOGRAPHY
PDF
SELECTION MECHANISM OF MICRO-SERVICES ORCHESTRATION VS. CHOREOGRAPHY
PPTX
Design Patterns for Micro Service Architecture
PPTX
Microservices Architecture & Testing Strategies
PPTX
AppDev with Microservices
PPTX
Chapter 1 Introduction- DS.pptx
PDF
IBM --Enterprise messaging in the cloud
PDF
Microservices: Detailed Guide
PDF
Emerging trends and technologies in Cloud Computing.pdf
PDF
Security and Privacy Aware Programming Model for IoT Applications in Cloud En...
PDF
SECURITY AND PRIVACY AWARE PROGRAMMING MODEL FOR IOT APPLICATIONS IN CLOUD EN...
PDF
SECURITY AND PRIVACY AWARE PROGRAMMING MODEL FOR IOT APPLICATIONS IN CLOUD EN...
PDF
SECURITY AND PRIVACY AWARE PROGRAMMING MODEL FOR IOT APPLICATIONS IN CLOUD EN...
Pitfalls & Challenges Faced During a Microservices Architecture Implementation
Micro services Architecture with Vortex -- Part I
Comprehensive Study on Deployment Models and Service Models in Cloud Computing.
Building a High-Performance Reactive Microservices Architecture
1213532535.pdf
SELECTION MECHANISM OF MICRO-SERVICES ORCHESTRATION VS. CHOREOGRAPHY
SELECTION MECHANISM OF MICRO-SERVICES ORCHESTRATION VS. CHOREOGRAPHY
Design Patterns for Micro Service Architecture
Microservices Architecture & Testing Strategies
AppDev with Microservices
Chapter 1 Introduction- DS.pptx
IBM --Enterprise messaging in the cloud
Microservices: Detailed Guide
Emerging trends and technologies in Cloud Computing.pdf
Security and Privacy Aware Programming Model for IoT Applications in Cloud En...
SECURITY AND PRIVACY AWARE PROGRAMMING MODEL FOR IOT APPLICATIONS IN CLOUD EN...
SECURITY AND PRIVACY AWARE PROGRAMMING MODEL FOR IOT APPLICATIONS IN CLOUD EN...
SECURITY AND PRIVACY AWARE PROGRAMMING MODEL FOR IOT APPLICATIONS IN CLOUD EN...
Ad

Recently uploaded (20)

PPTX
Programs and apps: productivity, graphics, security and other tools
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PPTX
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
PPT
Teaching material agriculture food technology
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PPTX
Cloud computing and distributed systems.
PDF
KodekX | Application Modernization Development
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PPTX
Big Data Technologies - Introduction.pptx
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
Approach and Philosophy of On baking technology
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
cuic standard and advanced reporting.pdf
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
Programs and apps: productivity, graphics, security and other tools
MIND Revenue Release Quarter 2 2025 Press Release
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
Teaching material agriculture food technology
NewMind AI Weekly Chronicles - August'25 Week I
Reach Out and Touch Someone: Haptics and Empathic Computing
Cloud computing and distributed systems.
KodekX | Application Modernization Development
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Big Data Technologies - Introduction.pptx
Diabetes mellitus diagnosis method based random forest with bat algorithm
Spectral efficient network and resource selection model in 5G networks
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Approach and Philosophy of On baking technology
Chapter 3 Spatial Domain Image Processing.pdf
cuic standard and advanced reporting.pdf
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
20250228 LYD VKU AI Blended-Learning.pptx
Unlocking AI with Model Context Protocol (MCP)
Per capita expenditure prediction using model stacking based on satellite ima...

Modularity by Microservices

  • 1. Modularity by Microservices Tech Festival #INGLovesIT How can DDD help in decomposing applications in microservices? Bucharest, 7th of April 2017 ,
  • 2. Agenda 2 What are microservices? Whats is DDD? Introduction to the most important DDD patterns Microservices revisited Conclusions: Design Rules
  • 3. What are microservices? Source: https://www.martinfowler.com/bliki/MicroservicePrerequisites.html 3
  • 4. Microservices characteristics*  Componentization via Services  Organized around Business Capabilities  Products not Projects  Smart endpoints and dumb pipes  Decentralized Governance  Decentralized Data Management  Infrastructure Automation  Design for failure  Evolutionary Design *Reference: https://martinfowler.com/articles/microservices.html 4
  • 5. Microservices benefits  Agility in development  Better understanding of the architecture  Resilience in a production  Independent scalability of microservices  Independent deployment of microservices  Fault tolerance (failures in a microservice can be isolated from other microservices) 5
  • 6. Levels of abstractions 6 microservices modules packages classes The same concerns (high cohesion, low coupling, separation of concerns etc.) apply at all levels. “If people can’t build monoliths properly, microservices won’t help.” Simon Brown
  • 7. From monolith to microservices 7
  • 8. Problem #1: Data Services as Microservices  Layered Coupling  Communication Coupling The service is not autonomous 8
  • 9. Problem #2: Synchronous Integration between Microservices  Temporal Coupling  Behavioral Coupling* The services are not autonomous Complex and unreliable compensation logic Circuit breaker, timeouts, retries etc. are of limited use *Reference: http://iansrobinson.com/2009/04/27/temporal-and-behavioural-coupling/ 9
  • 10. How do we identify microservices? 10
  • 11. Introduction to DDD  Strategic Design:  bounded contexts  context map  Tactical Design:  entities  values  aggregates  aggregate roots  Repositories  services  domain events  application services 11 Reference: Evans, Eric. Domain-Driven Design: Tackling Complexity in the Heart of Software. Boston: Addison-Wesley, 2003, Vernon, Vaughn. Implementing Domain-Driven Design. Boston: Addison- Wesley, 2013.
  • 12. Aggregate Design Rules  Cluster entities into aggregates according to the invariants that really need to be guaranteed  Reference other aggregates only by root id (including ones from the same bounded context)  Limit aggregates to small set of data  Modify in one transaction only one aggregate instance 12
  • 13. Domain Events  An event captures the changes in the state of a single aggregate  Events are immutable  They get published by the aggregates and contain the associated aggregate root id  Each event should have a unique id that could be used for de-duplication 13
  • 14. Integration Rules between Bounded Contexts  Via a publish/subscriber messaging infrastructure  The bounded contexts interested in the data maintained by other bounded contexts subscribe to the relevant events  Integration via events is applicable also between different aggregate instances from the same bounded context  Transactional Consistency within aggregate boundaries  Eventual Consistency between different bounded contexts and between different aggregate instances 14
  • 16. Messaging Requirements in View of DDD  Support for publish/subscriber pattern  Support for competing consumers pattern  Persistence and Durability  At-least-once message delivery  Partial message ordering (per aggregate) 16
  • 17. Application Technical Requirements in View of DDD  Transactional semantics when publishing events  Events deduplication on subscriber-side for achieving exactly-once delivery semantics 17
  • 20. Packaging 20  Separation of business concerns from technological concerns  Apply Dependency Inversion Principle at domain boundaries
  • 22. Microservices Design Rules  1 microservice = 1 bounded context = 1 deployment unit  1 operation = 1 transaction = 1 aggregate  Prefer asynchronous communication between microservices over synchronous request/reply integration  data replication over events  Transactional consistency within a microservice / Eventual consistency between microservices 22
  • 23. Microservices Architecture Decomposing application into loosely coupled services: - Explicit contract/ interface - Boundary alignment with business capabilities - Asynchronous communication between microservices - Microservices have their own storage (they are the authoritative source of data for their domain) 1 2 3 4 1 2 3 4 23
  • 24. Microservices Benefits  Agility in development  Resilience in production  Microservices can be scaled independently  Data Scalability (Data Partitioning)  Microservices can be deployed independently (different deployment options should be made available by the architecture).  Failures in a microservice can be isolated from other microservices 24
  • 25. Conclusions  Microservices are mainly about design and only secondarily about technology  Domain Driven Design offers essential lessons on:  how to modularize your application in microservices  how to achieve resilience  how to achieve scalability 25