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
マイクロサービスアーキテクチャの話 / Micro service architecture
Search
iwashi
November 27, 2022
Technology
0
150
マイクロサービスアーキテクチャの話 / Micro service architecture
マイクロサービスアーキテクチャについてお話したときのスライド
iwashi
November 27, 2022
Tweet
Share
More Decks by iwashi
See All by iwashi
マネージャー&リーダー向け 社内トレーニング / Training of management and leadership for Stockmark
iwashi86
48
28k
30分でわかる「エンジニアのためのドキュメントライティング」- インフラエンジニアBooks / Docs for Developers within 30 minutes
iwashi86
9
2k
エンジニアのためのドキュメントライティング / Docs for Developers
iwashi86
29
17k
なぜ変化を起こすのが難しいのか? - 数年以上にわたって難しさに向き合い・考え取り組んできたこと / The reason why changing organization is so hard - What I thought and faced for more than several years
iwashi86
59
80k
2015年 第4四半期の WebRTC 標準化 アップデート / 2015 update of WebRTC Standards
iwashi86
0
170
外注が主な企業でどのように内製開発を立ち上げ・進化させているのか? / how we start in-house developement in enterprise?
iwashi86
2
29k
Extreme testing of WebRTC Applications
iwashi86
0
120
2019 IaaS Workshop in training for new employee at NTT Com
iwashi86
0
100
2017 SkyWayを使いこなすために / How to use SkyWay (WebRTC) in 2017
iwashi86
0
430
Other Decks in Technology
See All in Technology
One engineer company with Ruby on Rails
rstankov
2
420
認知症フレンドリーテックとスタックチャン
naokiuc
0
180
【NW X Security JAWS#3】L3-4:AWS環境のIPv6移行に向けて知っておきたいこと
shotashiratori
1
620
20分で完全に理解するGrafanaダッシュボード
hamadakoji
5
890
Microsoft Intune 勉強会 第 2 回目
tamaiyutaro
2
380
AWS学習者向けにAzureの解説スライドを作成した話
handy
3
190
EMとして2023年度に頑張ったこと / What we did well in FY2023 as a EM
pauli
1
210
実例で紹介するRAG導入時の知見と精度向上の勘所
yamahiro
5
1.6k
EM完全に理解した と思ったけど、 やっぱり何も分からなかった話 / EM Night Fukuoka #1
hirutas
0
280
Oracle Base Database Service 技術詳細
oracle4engineer
PRO
5
37k
エンジニア候補者向け資料2024.04.24.pdf
macloud
0
3.3k
IaCジェネレーターとBedrockで詳細設計書を生成してみた
tsukasa_ishimaru
4
880
Featured
See All Featured
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
14
1.5k
Rebuilding a faster, lazier Slack
samanthasiow
74
8.2k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
155
14k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
228
16k
Creatively Recalculating Your Daily Design Routine
revolveconf
211
11k
Embracing the Ebb and Flow
colly
80
4.2k
Atom: Resistance is Futile
akmur
260
25k
Rails Girls Zürich Keynote
gr2m
91
13k
Mobile First: as difficult as doing things right
swwweet
217
8.6k
Imperfection Machines: The Place of Print at Facebook
scottboms
261
12k
Debugging Ruby Performance
tmm1
70
11k
Producing Creativity
orderedlist
PRO
338
39k
Transcript
マイクロサービスアーキテクチャの話 2015/1/15 @iwashi86 みんなで構築・運用の話をしよう 第1回
•Attribute ・Name -> Yoshimasa IWASE ・Twitter -> @iwashi86 ・Web
-> iwashi.co •Work @ NTT Communications ・SkyWay(WebRTC)の裏側の開発運用 ・HTML5 Experts.jpというWebメディアの編集 2
今日のテーマ: マイクロサービスアーキテクチャ
バズった原典 http://martinfowler.com/articles/microservices.html
• アプリケーションを複数のサービスを組み合わせて 構築する • サービス間通信は、HTTP経由のAPIか軽量メッセー ジング(ex. RabbitMQ)を利用 •
サービス自体は独立してデプロイ&動作可能 In a nutshell
なんでもかんでも マイクロサービスアーキテクチャ?
http://martinfowler.com/articles/microservices/images/sketch.png モノリシック Web / AP / DB を全て含むタイプ (ex. Rails)
http://martinfowler.com/articles/microservices/images/sketch.png モノリシック Web / AP / DB を全て含むタイプ (ex. Rails)
マイクロサービス それぞれの機能が 独立しているタイプ
http://martinfowler.com/articles/microservices/images/sketch.png モノリシック Web / AP / DB を全て含むタイプ (ex. Rails)
マイクロサービス それぞれの機能が 独立しているタイプ どっちにも良いところ・悪いところがある なので両方の特徴を知ってから 自身の環境にあわせて選ぼう
• Good – シンプルなので開発期間は比較的に短い、デプロイも簡単 – 比較的に全体像をつかみやすい(特に新入りさん歓迎) • Bad – Big
ball of mud(※)になる – アジリティの欠如 • ひとたび機能変更があると、全部デプロイしたり • Caveat – 決してスケールしないわけじゃない(LBとか使えば?) モノリシックアーキテクチャ ※ 大きな泥団子が直訳だけど、もはやごった煮状態のスパゲッティ状態のサービスを、本スライドでは意味。 http://www.laputan.org/mud/
http://microservices.io/patterns/monolithic.html
http://microservices.io/patterns/monolithic.html これが巨大泥団子
http://microservices.io/patterns/monolithic.html これが巨大泥団子 素敵なスパゲッティ
• Good – サービスごとに独立してデプロイ&スケールできる – 影響範囲が明確 – チームごとにパラレルに開発しやすい – 特定の技術へのロックインを避けやすい
• Bad – 複雑になる(可動部分・結合部分が多いので) – サービスモニタリングがより大変 マイクロサービスアーキテクチャ ※ 大きな泥団子が直訳だけど、もはやごった煮状態のスパゲッティ状態のサービスを、本スライドでは意味。 http://www.laputan.org/mud/
独立してデプロイ& スケール 分岐点が明確 こっちはRails こっちはdjango http://microservices.io/patterns/microservices.html
マイクロサービスアーキテクチャ について、もうちょっとkwsk
9つの特徴 1. Componentization via Services 2. Organized around Business Capabilities
3. Products not Projects 4. Smart endpoints and dumb pipes 5. Decentralized Governance 6. Decentralized Data Management 7. Infrastructure Automation 8. Design for Failure 9. Evolutionary Design
1. Componentization via Services • マイクロサービスでは、主要な機能はライブラリではなく 別プロセスで動作するサービスとして切り出す (コンポーネントとは別) •
良い所 – IFが明確で疎結合にできる – デプロイがコンポーネント単位で済む • (前提:用語) – コンポーネント:ライブラリ内の関数呼び出しで完結する要素 – サービス:HTTP APIやRPCで呼び出しする要素
2. Organized around Business Capabilities • ビジネス能力にもとづいてチームを分割しよう • だってコンウェイの法則に従って、 チーム構造とシステム構造は同じになるから
• 詳細は図にて
http://martinfowler.com/articles/microservices/images/conways-law.png
じゃなくて http://martinfowler.com/articles/microservices/images/conways-law.png
http://martinfowler.com/articles/microservices/images/PreferFunctionalStaffOrganization.png
人数にもよるが、割とフルス タックな能力が求められる (ex. UX, Web, NW, DB, PM) http://martinfowler.com/articles/microservices/images/PreferFunctionalStaffOrganization.png
3. Products not Projects • 今まで – アプリケーション開発は 「期限のあるプロジェクト」として管理しておいて 開発がおわってデプロイして終わり
• マイクロサービスだと – 継続的なプロダクトとして開発運用していく で、ビジネスとして価値を高める – Amazonの build it / run it 精神 • 作ったもの24時間365日、運用まで含めて責任を持つ ⇒ 深夜にたたき起こされたくなくて品質を高めようと頑張る (DevOpsな感じですね)
4. Smart endpoints and dumb pipes • クラウド界隈でいえば
OpenStackな感じ http://c204396.r96.cf1.rackcdn.com/nova-cactus-logical.gif
5. Decentralized Governance • 中央集権型 ⇒ 単一のプラットフォームになりがち ⇒ 活動の抑制につながる • 分割統治(マイクロサービスアーキテクチャだと)
– 標準化された技術がベストなわけじゃない – 自身の問題解決に適した言語やDBを選択しよう – たとえばあるサービスはC++でも良いし、 あるサービスはNode.jsで作っても良い (上記実現は、アーキテクチャが疎結合だと特に容易)
6. Decentralized Data Management • 一括管理できる統合データベースを作るのじゃなくて それぞれのサービスでデータベースを持とう • (ただし、一貫性を保つのは結構大変)
7. Infrastructure Automation • 説明するより見たほうが早し:
7. Infrastructure Automation 引用:http://www.athlsolutions.com/web/Portals/0/news/N_2014.10.07_01z1.jpg
7. Infrastructure Automation 引用:http://www.athlsolutions.com/web/Portals/0/news/N_2014.10.07_01z1.jpg 要は自動化してCI/CDしよう
8. Design for Failure • 外部のサービスはいつの間にか死んでいるかもしれない • またいつの間にか復旧しているかもしれない なので・・・
8. Design for Failure • 外部のサービスはいつの間にか死んでいるかもしれない • またいつの間にか復旧しているかもしれない なので・・・
• マイクロサービスアーキテクチャでは、 サービス障害の影響を常に考慮しておく • また自身の提供するサービス障害はいち早く検知する
9. Evolutionary Design • サービス単位に進化できるような設計にする • 進化させる場合は – アップグレード –
廃棄(コンテナちっく) ← こっちがオススメ • Blue Green な Deploy とか
まとめ(再掲) 1. Componentization via Services 2. Organized around Business Capabilities
3. Products not Projects 4. Smart endpoints and dumb pipes 5. Decentralized Governance 6. Decentralized Data Management 7. Infrastructure Automation 8. Design for Failure 9. Evolutionary Design