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
220
マイクロサービスアーキテクチャの話 / Micro service architecture
マイクロサービスアーキテクチャについてお話したときのスライド
iwashi
November 27, 2022
Tweet
Share
More Decks by iwashi
See All by iwashi
n=1の経験が紡ぐエンジニアリングマネジメントの可能性 / The Possibilities of Engineering Management from n=1 Experiences
iwashi86
11
1.5k
エンジニアリングが好きな私たちのためのエンジニアリングマネジャー入門 / Engineering management for the rest of us
iwashi86
22
5.2k
エレガントパズル 30分 ダイジェスト版/ Elegant Puzzle 30min Digest
iwashi86
5
570
エレガントパズル エンジニアのマネジメントという難問にあなたはどう立ち向かうのか / Elegant Puzzle
iwashi86
18
4k
ベロシティを高く保つ仕事のすすめ方 / Maintaining a High Velocity as Productivity Hacks
iwashi86
54
20k
マネージャー&リーダー向け 社内トレーニング / Training of management and leadership for Stockmark
iwashi86
65
32k
30分でわかる「エンジニアのためのドキュメントライティング」- インフラエンジニアBooks / Docs for Developers within 30 minutes
iwashi86
9
2.5k
エンジニアのためのドキュメントライティング / Docs for Developers
iwashi86
34
22k
なぜ変化を起こすのが難しいのか? - 数年以上にわたって難しさに向き合い・考え取り組んできたこと / The reason why changing organization is so hard - What I thought and faced for more than several years
iwashi86
60
88k
Other Decks in Technology
See All in Technology
オブザーバビリティの観点でみるAWS / AWS from observability perspective
ymotongpoo
9
1.7k
速くて安いWebサイトを作る
nishiharatsubasa
15
15k
ディスプレイ広告(Yahoo!広告・LINE広告)におけるバックエンド開発
lycorptech_jp
PRO
0
140
エンジニアが加速させるプロダクトディスカバリー 〜最速で価値ある機能を見つける方法〜 / product discovery accelerated by engineers
rince
4
500
生成 AI プロダクトを育てる技術 〜データ品質向上による継続的な価値創出の実践〜
icoxfog417
PRO
5
1.8k
実は強い 非ViTな画像認識モデル
tattaka
1
630
人はなぜISUCONに夢中になるのか
kakehashi
PRO
6
1.7k
Swiftの “private” を テストする / Testing Swift "private"
yutailang0119
0
140
(機械学習システムでも) SLO から始める信頼性構築 - ゆる SRE#9 2025/02/21
daigo0927
0
220
クラウドサービス事業者におけるOSS
tagomoris
3
960
抽象化をするということ - 具体と抽象の往復を身につける / Abstraction and concretization
soudai
27
14k
株式会社EventHub・エンジニア採用資料
eventhub
0
4.3k
Featured
See All Featured
Designing on Purpose - Digital PM Summit 2013
jponch
117
7.1k
Bootstrapping a Software Product
garrettdimon
PRO
306
110k
Learning to Love Humans: Emotional Interface Design
aarron
273
40k
Bash Introduction
62gerente
611
210k
How to Ace a Technical Interview
jacobian
276
23k
How To Stay Up To Date on Web Technology
chriscoyier
790
250k
The Illustrated Children's Guide to Kubernetes
chrisshort
48
49k
StorybookのUI Testing Handbookを読んだ
zakiyama
28
5.5k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
29
2.4k
Agile that works and the tools we love
rasmusluckow
328
21k
Statistics for Hackers
jakevdp
797
220k
A better future with KSS
kneath
238
17k
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