Slide 1

Slide 1 text

© 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark. © 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark. ドメイン駆動設計と マイクロサービスアーキテクチャ AWS Developer Live Show 出張編 🚅 💨 宇賀神みずき @syobochim Delivery Consultant – AppMod アマゾン ウェブ サービス ジャパン合同会社

Slide 2

Slide 2 text

© 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark. Who am I ? "84+BQBO%FMJWFSZ$POTVMUBOU ओʹΞϓϦέʔγϣϯ։ൃͷ͝ࢧԉΛ୲౰ ஶॻʮ͍ͪ͹Μ΍͍͞͠(JU(JU)VCͷڭຊʯ しょぼちむ 宇賀神みずき @syobochim

Slide 3

Slide 3 text

© 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark. エリック・エヴァンスのドメイン駆動設計をグラレコノートにまとめて公開 ドメイン駆動設計の原書を読むのが⼀番 だけど難しそう・ハードルが⾼そうという⽅は ぜひ、ドメイン駆動設計を始めるきっかけにしてください 🙌✨ 例えば ざっくりとノートを読んで理解して 気になったところは書籍で深掘りする ブログにPDF公開しています︓https://syobochim.hatenablog.com/entry/2022/03/04/194646

Slide 4

Slide 4 text

© 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark. 4

Slide 5

Slide 5 text

© 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark. プログラミングや開発の課題に特化したテーマの 技術解説、ディスカッションを AWS スペシャリストが、 AWS 公式 YouTube チャンネルから ライブセッションでお届けしています。 AWS Developer Live Show とは ? これまでのアーカイブ視聴はこちら

Slide 6

Slide 6 text

© 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark. 本セッションの対象者とゴール 対象聴講者 • DDDやマイクロサービスに興味がある・基本的な考えは知っているが、実践で悩んでいる • 理論は知っているが「どこで境界を引くか」「どう関連させていくか」の判断に迷っている セッションのゴール • 境界の引き⽅の判断基準がわかる • ドメイン駆動設計とマイクロサービスアーキテクチャの各概念の関係性を理解する • 実践的な知⾒を得る ワイワイ、楽しく進めていきたいです︕🙌✨ (途中で⾊々脱線しがちです… 🙏) 6

Slide 7

Slide 7 text

© 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark. ⾃⼰紹介 v名前 v福井 厚(ふくい あつし)Atsushi Fukui(afukui@) v所属 vアマゾン ウェブ サービス ジャパン合同会社 vデベロッパートランスフォーメーションチーム vシニアデベロッパースペシャリスト ソリューションアーキテクト v関⼼領域 vソフトウェア アーキテクチャ、ドメイン駆動設計、アジャイル開発 v好きなAWSサービス vサーバーレス全般

Slide 8

Slide 8 text

© 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark.

Slide 9

Slide 9 text

© 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark. © 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark. ドメイン駆動設計と マイクロサービスアーキテクチャ 9 ドメイン駆動設計でどのように境界を分けていくのか︖ 分けたものをどのようにマイクロサービスと組み合わせていくのか︖

Slide 10

Slide 10 text

© 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark. © 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark. と… その前に… 10

Slide 11

Slide 11 text

© 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark. © 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark. 11 本当にマイクロサービスアーキテクチャで ⾏きますか︖︖︖︖︖

Slide 12

Slide 12 text

© 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark. 1. Almost all the successful microservice stories have started with a monolith that got too big and was broken up 2. Almost all the cases where Iʻve heard of a system that was built as a microservice system from scratch, it has ended up in serious trouble. This pattern has led many of my colleagues to argue that you shouldnʼt start a new project with microservices, even if youʻre sure your application will be big enough to make it worthwhile. ⽇本語訳: 1. 成功しているマイクロサービスの事例のほぼすべてが、⼤きくなりすぎたモノリスを分割することから始まっている 2. 最初からマイクロサービスシステムとして構築されたシステムの事例のほぼすべてが、深刻な問題に直⾯している このパターンから、私の同僚の多くは次のように主張しています。アプリケーションが⼗分に⼤きくなることが確実だ としても、新しいプロジェクトをマイクロサービスで始めるべきではない。 Martin Fowler https://martinfowler.com/bliki/MonolithFirst.html 12

Slide 13

Slide 13 text

© 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark. © 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark. 前提: マイクロサービスのメリット・デメリットを ⽐較した上で、マイクロサービスを選択した場合 13

Slide 14

Slide 14 text

© 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark. ポイントとなる概念 14 サブドメイン 事業を実現するために、業務を分析して分割したもの 境界づけられたコンテキスト モデルを作るための境界であり、 ユビキタス⾔語を同じ意味で適⽤できる範囲 集約 ⼀貫性を保証すべき最⼩の単位 マイクロサービス 独⽴してデプロイ可能なサービス サービス同⼠はネットワークを介して 相互に通信し、システムを形成する

Slide 15

Slide 15 text

© 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark. サブドメインと境界づけられたコンテキストの関係性 15 サブドメイン 事業を実現するために、業務を分析して分割したもの 境界づけられたコンテキスト モデルを作るための境界であり、 ユビキタス⾔語を同じ意味で適⽤できる範囲 ディスカッション🎙: サブドメインと境界づけられたコンテキストの関係性は︖ どんな時に、どっちが⼤きい︖どっちが⼩さい︖どういう時に分割しようと思う︖

Slide 16

Slide 16 text

© 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark. 16 ディスカッション🎙: サブドメインと境界づけられたコンテキストの関係性は︖ どんな時に、どっちが⼤きい︖どっちが⼩さい︖どういう時に分割しようと思う︖ サブドメインと境界づけられたコンテキストの関係性

Slide 17

Slide 17 text

© 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark. 境界づけられたコンテキストとマイクロサービスの関係性 17 サブドメイン 事業を実現するために、業務を分析して分割したもの 境界づけられたコンテキスト モデルを作るための境界であり、 ユビキタス⾔語を同じ意味で適⽤できる範囲 集約 ⼀貫性を保証すべき最⼩の単位 マイクロサービス 独⽴してデプロイ可能なサービス サービス同⼠はネットワークを介して 相互に通信し、システムを形成する

Slide 18

Slide 18 text

© 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark. 境界づけられたコンテキストとマイクロサービスの関係性 18 境界づけられたコンテキスト モデルを作るための境界であり、 ユビキタス⾔語を同じ意味で適⽤できる範囲 マイクロサービス 独⽴してデプロイ可能なサービス サービス同⼠はネットワークを介して 相互に通信し、システムを形成する ディスカッション🎙: 境界づけられたコンテキストとサービスは1対1︖そうじゃない時って︖ モデルが共有されるパターンもある中で、コード・システムの管理の⼯夫は︖

Slide 19

Slide 19 text

© 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark. 粒度と複雑さの関係性 19 構造はシンプル(1つ)だけど 中が整理されておらず、複雑… (巨⼤な泥団⼦) vs ⼀つ⼀つは⼩さくてシンプルだけど 構造が複雑… (分散した泥団⼦)

Slide 20

Slide 20 text

© 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark. 参考︓ チームトポロジー Chapter 6 20

Slide 21

Slide 21 text

© 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark. 境界づけられたコンテキストとマイクロサービスの関係性 21 境界づけられたコンテキスト モデルを作るための境界であり、 ユビキタス⾔語を同じ意味で適⽤できる範囲 マイクロサービス 独⽴してデプロイ可能なサービス サービス同⼠はネットワークを介して 相互に通信し、システムを形成する ディスカッション🎙: どういう観点で境界づけられたコンテキストからサービスを分ける︖ モデルが共有されるパターンもある中で、コード・システムの管理の⼯夫は︖ 再 掲

Slide 22

Slide 22 text

© 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark. よくある誤解: サーバレス = マイクロサービス 22 もっとパフォーマンス・コストを API レベルで最適化するなら

Slide 23

Slide 23 text

© 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark. 境界を分割した︕そのあとは・・・何から着⼿する︖ 23 議論ポイント🎙︓何を基準に「作り始めるサービス」を選んでいますか︖ 他のサービスとの連携数︖ サブドメインの種類から︖ 新規サービスの場合と、 既存システムを切り出している場合は︖

Slide 24

Slide 24 text

© 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark. 24 議論ポイント🎙︓⽣成AIを使って、より効率的に良いものを開発するには︖ 作るものが決まった︕作る順序も決まった︕そのあとは…

Slide 25

Slide 25 text

© 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark. 25 © 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark. AI-DLCとは

Slide 26

Slide 26 text

© 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark. 26 ステップ・アップではなく、 パラダイム・リープを達成するには︖

Slide 27

Slide 27 text

© 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark. 27 © 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark. 現状、何がうまくいかないのか

Slide 28

Slide 28 text

© 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark. 28 開発者は現在、 2つのアプローチを使っている。

Slide 29

Slide 29 text

© 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark. 29 AIは⾃律的にソフトウェア を構築・保守し、⼈間の 関与は最⼩限かゼロである AI-Managed 開発者は依然として 知的な⼒仕事を⾏い、 AIを狭いタスクに適⽤している AI-Assisted

Slide 30

Slide 30 text

© 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark. 30 © 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark. どうすればうまくいくのか

Slide 31

Slide 31 text

© 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark. 31 AIは、プランニング、タスク分解 アーキテクチャの提案など、 開発プロセスを実⾏する 開発者は、検証、意思決定、 監督の最終的な責任を保持する AI-Driven Development Lifecycle (AI-DLC)

Slide 32

Slide 32 text

© 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark. 32 AI Creates Plan Humans Verify the Plan AI Refines the Plan AI Executes the Plan Humans Verify the Outcome AIは、プランニング、タスク分解 アーキテクチャの提案など、 開発プロセスを実⾏する 開発者は、検証、意思決定、 監督の最終的な責任を保持する

Slide 33

Slide 33 text

© 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark. 33 AI-Driven Development Lifecycle (AI-DLC) 1. 既存のコードの上にコンテキストを構築する 2. ユーザーストーリーで意図を詳しく説明する 3. 仕事のユニットで計画を⽴てる 4. ドメインモデル(コンポーネントモデル) 5. アーキテクチャコンポーネントの追加 6. コードとテストの⽣成 7. IaCとテストの⽣成 8. IaCを使った本番環境でのデプロイ 9. インシデントの管理 各ステップが 次のステップへの リッチな コンテキストを 構築 Inception Construction Operation

Slide 34

Slide 34 text

© 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark. 34 Mob Elaboration Inception : Mob Elaboration

Slide 35

Slide 35 text

© 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark. 35 Mob Construction 未来の開発者チームは並⾏して構築し、 コラボレーションする 未来の開発者の「ペルソナ」 ü バリューチェーンへの移⾏(「チケットから コード」から「ビジネス要求からコード」へ) ü 判断のスピードで反復する ü 継続的なフロー、開発者の最⼤限の満⾜ ü 硬直した専⾨化のサイロを超える ü 桁違いの効果 Construction : Mob Construction

Slide 36

Slide 36 text

© 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark. ポイントとなる概念 36 サブドメイン 事業を実現するために、業務を分析して分割したもの 境界づけられたコンテキスト モデルを作るための境界であり、 ユビキタス⾔語を同じ意味で適⽤できる範囲 集約 ⼀貫性を保証すべき最⼩の単位 マイクロサービス 独⽴してデプロイ可能なサービス サービス同⼠はネットワークを介して 相互に通信し、システムを形成する 再 掲

Slide 37

Slide 37 text

© 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark. 37

Slide 38

Slide 38 text

© 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark. 38 プログラミングや開発の課題に特化したテーマの 技術解説、ディスカッションを AWS スペシャリストが、 AWS 公式 YouTube チャンネルから ライブセッションでお届けしています。 AWS Developer Live Show とは ? これまでのアーカイブ視聴はこちら

Slide 39

Slide 39 text

© 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark. Thank you! © 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark. @syobochim @fatsushi @nrs