Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Fundamental Domain-Driven Design For Microservices
Search
Oliver Drotbohm
July 07, 2016
Programming
710
4
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Fundamental Domain-Driven Design For Microservices
Slides of the talk I gave at Java Forum Stuttgart 2016.
#jfs2016 @springcentral
Oliver Drotbohm
July 07, 2016
More Decks by Oliver Drotbohm
See All by Oliver Drotbohm
What's new in Spring Modulith?
olivergierke
1
350
Domain-centric? Why Hexagonal and Onion Architecture Are Answers to the Wrong Question
olivergierke
4
2.1k
It Takes Two to Tango – Designing Module Interactions in Modulithic Spring Applications
olivergierke
5
850
Bottom-Up Architecture – Bridging the Achitecture Code Gap
olivergierke
4
1.1k
Spring Modulith – A Deep Dive
olivergierke
9
5.8k
Spring for the Architecturally Curious Developer
olivergierke
5
2k
Spring Boot 3 & Spring Framework 6
olivergierke
4
2.1k
Architecturally-evident Java Applications with jMolecules
olivergierke
9
3.2k
A Deep Dive into Spring Application Events
olivergierke
12
3.6k
Other Decks in Programming
See All in Programming
不幸な GC
chencmd
0
830
レビュー履歴をAIに食わせて、 Compose移行を加速するs
shihochan
0
240
コンパウンドプロダクト開発のためのローカルプロセスマネージャー再発明 #layerxgo
izumin5210
0
530
Claude CodeとAgentCore Gatewayを繋ぐ際の認証認可 / Authentication and authorization when connecting Claude Code with AgentCore Gateway
har1101
2
400
Japan Community Day at Kubecon + CloudNativeCon Japan 2026: Learning Container Privilege Control by Building My Own Low-Level Container Runtime
ternbusty
1
180
まだ間に合う!今年の夏こそSchemeのマクロ展開器を完全理解!
omasanori
0
570
freeeにおけるEvalsの実践例の紹介
freee
PRO
0
160
源内ハンズオン概要編
hideg
0
230
PyConJP2026_wat_Python × Signal Processing: How to Draw Pictures with Sound Using Spectrogram Art
wat
0
590
in-process GraphQL のすすめ #ginzajs
izumin5210
4
1.5k
KotlinConf Extended South Korea 2026 Keynote
l2hyunwoo
0
130
信頼性の目標を誰も求めてない
shubox
0
400
Featured
See All Featured
My Coaching Mixtape
mlcsv
0
300
[RailsConf 2023] Rails as a piece of cake
palkan
59
6.9k
How to build a perfect <img>
jonoalderson
1
5.9k
Navigating Algorithm Shifts & AI Overviews - #SMXNext
aleyda
1
1.6k
Rebuilding a faster, lazier Slack
samanthasiow
85
9.6k
Noah Learner - AI + Me: how we built a GSC Bulk Export data pipeline
techseoconnect
PRO
0
400
Marketing Yourself as an Engineer | Alaka | Gurzu
gurzu
0
280
How to make the Groovebox
asonas
2
2.4k
A brief & incomplete history of UX Design for the World Wide Web: 1989–2019
jct
2
490
Leveraging Curiosity to Care for An Aging Population
cassininazir
1
480
Test your architecture with Archunit
thirion
2
2.4k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
47
8.3k
Transcript
© 2014 SpringOne 2GX. All rights reserved. Do not distribute
without permission. DOMAIN-DRIVEN DESIGN / OLIVERGIERKE ƻ
[email protected]
FUNDAMENTAL FOR MICROSERVICES
2
None
4 http://www.infoq.com/minibooks/domain-driven-design-quickly
Microservices ♥ Domain-Driven Design 5 11:10 — Beethoven Saal
6
6
Implementing Domain-Driven Design 7
Value objects 8
Stringly typed code 9 public class Customer { private Long
id; private String firstname, lastname, email; … }
Stringly typed code 10 public class SomeService { public void
createUser(String firstname, String lastname, String email) { … } }
11 public class Customer { private Long id; private Firstname
firstname; private Lastname lastname; private EmailAddress emailAddress; … }
Value Objects are a PITA to build in some languages.
12
Still, they’re worth it. 13 See „Power Use of Value
Objects in DDD“ by Dan Bergh Johnsson.
Lombok — putting the spice back into Java. 14
15 @Value public class Customer { UUID id = UUID.randomUUID();
Firstname firstname; Lastname lastname; EmailAddress email; @Value static class EmailAddress { String value; } }
AutoValue 16 Project website on GitHub.
Entities & Aggregates 17
18 Order LineItem Product Invoice Customer Payment Address Email
18 Order LineItem Product Invoice Customer Payment Address Email
Persistence technology VS. Domain model 19
Aggregate = Entity + Repository 20
21 Order LineItem Product Invoice Customer Payment Address Email
Bounded Context 22
Order LineItem Product Invoice Customer Payment Address
24 Shipping Accounting Catalog Orders User Registration
24 Shipping Accounting Catalog Orders User Registration Accounting Payment information
Billing Address Shipping Shipping address Customer Product
Domain-Driven Design & Monoliths 25
Avoid technologies that get in your way. 26
How to enforce context boundaries? 27
What about consistency? 28
References between Bounded Contexts? 29
Domain Events 30
31 Level 0: No events at all
31 Level 0: No events at all Level 1: Explicit
operations
If you’re calling two setters in a row, you’re missing
a concept. 32
33 Level 0: No events at all Level 1: Explicit
operations Level 2: Some operations as events
State transitions become domain events. 34
35 Level 0: No events at all Level 1: Explicit
operations Level 2: Some operations as events Level 3: Event Sourcing
Domain-Driven Design & Microservices 36
Bounded contexts define system boundaries. 37
38 Shipping Accounting Catalog Orders User Registration Accounting Payment information
Billing Address Shipping Shipping address Customer Product
39 Shipping Accounting Catalog Orders User Registration Accounting Shipping
40 Shipping Accounting Catalog Orders User Registration Accounting Shipping HTTP
Messaging
Architecture is less likely to deteriorate as it’s harder to
violate boundaries. 41
Restructuring service boundaries is much harder. 42
Inter-Service communication becomes remote communication. 43
Accept and embrace eventual consistency between services. 44
Domain Events 45
REST & Messaging 46
Domain events become state transitions. 47
Hypermedia for state transition and explicit events. 48
Thanks! 49