Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
DDDモデリング勉強会 #9
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
株式会社Jurabi
October 01, 2024
Programming
40
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
DDDモデリング勉強会 #9
DDDモデリング勉強会#9 の発表資料
ドメインイベント、アグリゲーションルート、結果整合性に焦点を当てて、モデルを作成するハンズオン です。
株式会社Jurabi
October 01, 2024
More Decks by 株式会社Jurabi
See All by 株式会社Jurabi
DDDモデリング勉強会 #6
jurabi
0
71
DDDモデリング勉強会 #7
jurabi
0
28
Deep Learning勉強会 逆伝播の仕組み
jurabi
0
52
RDBの世界をぬりかえていくモデルグラフDB〜truncus graphによるモデルファースト開発〜
jurabi
0
420
Other Decks in Programming
See All in Programming
海上で動くGoサーバー: goroutineとchannelでさばく航行データストリーム
atsuki_seo
0
970
Augmenting AI with the Power of Jakarta EE
ivargrimstad
0
380
thread_parallel_with_free-threaded_Python_and_NumPy.pdf
riku_sakamoto
0
360
AI活用は、個人から組織へ|マルチプレイヤーエージェントハーネス「QM」の社内活用事例 / AI use is moving from individuals to orgs
rkaga
1
270
速習iPhone Duo対応
yuukiw00w
2
840
JPUG勉強会 OSSデータベースの内部構造を理解しよう(第2回)
oga5
0
280
すこし踏み込む CancellationToken
htkym
2
1.3k
選挙速報を多くのユーザーへ 届ける Live Activities 設計
hamayokokuririn
0
180
Everything will be SERVERLESS — 信じて運用した10年の経験値 / Everything Will be Serverless — Lessons Learned from 10 Years of Operational Experience
seike460
PRO
1
540
JRuby: Past, Present, and Future
headius
0
210
App Storeの外へ──日本のiOSサイドローディング入門 for iOSDC Japan 2026
yuukiw00w
0
260
Intent as Code
shoppingjaws
6
1.1k
Featured
See All Featured
Impact Scores and Hybrid Strategies: The future of link building
tamaranovitovic
0
440
What's in a price? How to price your products and services
michaelherold
247
13k
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.8k
Scaling GitHub
holman
464
140k
Bioeconomy Workshop: Dr. Julius Ecuru, Opportunities for a Bioeconomy in West Africa
akademiya2063
PRO
1
370
The AI Search Optimization Roadmap by Aleyda Solis
aleyda
1
6.2k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
31
10k
Build your cross-platform service in a week with App Engine
jlugia
234
19k
YesSQL, Process and Tooling at Scale
rocio
174
15k
Self-Hosted WebAssembly Runtime for Runtime-Neutral Checkpoint/Restore in Edge–Cloud Continuum
chikuwait
0
840
Agile Leadership in an Agile Organization
kimpetersen
PRO
0
250
Highjacked: Video Game Concept Design
rkendrick25
PRO
1
460
Transcript
DDDモデリング勉強会 第9回 2016/9/2 (金) 19:00 – 20:30
アジェンダ • ドメインイベント、アグリゲーションルート、結果整合性 • モデリングのお題 • モデリング • 総括 2
ドメインイベント、アグリゲーションルート、結果整合性 1トランザクションのシステムの例 受注から在庫確認、注文確定、在庫引当など、全部1トランザク ションで整合性を保って処理 3 <Root> 販売管理 在庫管理 同一トランザクションで 処理する範囲
ドメインイベント、アグリゲーションルート、結果整合性 システムが分散する例 • ドメインイベントでアグリゲーションルート間の連携をとる • 完全な一貫性を実現することは困難 4 <Root> 販売管理 <Root>
在庫管理 別々のトランザクションで処理 複数のアグリゲーションルート
ドメインイベント、アグリゲーションルート、結果整合性 ドメインイベントとは • ドメインエキスパートが気に掛ける何かの出来事 • ドメイン内で発生する何かの出来事 • 「・・・・するときに、」 • 「もしそうなったら、・・・」
• 「・・・の場合は、通知してほしい」 • 「・・・が発生した場合、・・」 • 「もし、こうなったら、・・・・」 5
ドメインイベント、アグリゲーションルート、結果整合性 ドメインイベントの特徴 • ドメイン全体にまたがる概念 • 単一の境界づけられたコンテキストで閉じない • 発生した出来事 既に発生した出来事を表す(不変) (例)
実行コマンド BacklogItem#commitTo(Sprint s) 発生イベント BacklogItemCommitted コミットされた(成功した)ことを示している 6
ドメインイベント、アグリゲーションルート、結果整合性 一貫性がなくても業務は成り立つ • 販売管理側の在庫数は、いわゆるキャッシュ • それぞれの在庫数は常に一致しているわけではない • 受注(1個) 販売管理:29個 在庫管理:30個
• 受注(2個) 販売管理:27個 在庫管理:30個 • 在庫引当(3個) 販売管理:27個 在庫管理:27個 • 在庫数更新 販売管理:27個 在庫管理:27個 7 <Root> 販売管理 <Root> 在庫管理 在庫数:30個 在庫数:30個
モデリングのお題 ハンバーガーの注文を管理するシステム • 全店舗、倉庫を一括管理するアーキテクチャ 8
モデリングのお題 9
モデリングのお題 10
モデリングのお題 チェーンの成長にともない問題発生! 11 店舗、倉庫が増加 注文、在庫の引き当てが大量に発生 レコードのロックにより、 一定数以上の注文を受け付けられなくなった
モデリングのお題 課題 12 ドメインイベント、結果整合性を使って、問題が解決可 能となるようにドメインモデルを修正してください 業務要件、制限 • 商品の製造中に材料の在庫切れ等が発生した場合は、製造 途中の商品は廃棄してよいこととします •
物流にかかる時間、コストは0とし、発注をまとめる必要 はありません
13 総括