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
はてなリモートインターンシップ2022 マイクロサービス 講義資料
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Hatena
December 19, 2022
Programming
310
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
はてなリモートインターンシップ2022 マイクロサービス 講義資料
https://hatena.co.jp/recruit/intern/2022
Hatena
December 19, 2022
More Decks by Hatena
See All by Hatena
Androiderを育成する「高速道路」と 実戦を経て辿り着いた現在地 / DroidKaigi 2026
hatena
0
190
60分で学ぶクラウドとSRE・サービス運用 / GeekCAMPAcademia 2026-05
hatena
1
140
エンジニアリング マネージャーの育成と評価軸の考え方
hatena
0
730
Perlブートキャンプ
hatena
0
5.7k
はてなサマーインターンシップ2025 Web API 講義資料
hatena
0
1.8k
はてなサマーインターンシップ2025 フロントエンド 講義資料
hatena
21
11k
はてなサマーインターンシップ2025 コンテナ + Kubernetesハンズオン 講義資料
hatena
0
850
はてなサマーインターンシップ2025 クラウドと運用 講義資料
hatena
0
890
はてなサマーインターンシップ2025 RDBMSの基礎 講義資料
hatena
0
1k
Other Decks in Programming
See All in Programming
Java 27新機能 / Java 27 new features
kishida
2
200
難しいけど、読めた。- OSSの入口に立った話。
sts11142
0
140
Herb in Rails 8.2: Your ERB views, now HTML-aware @ Rails World 2026, Austin, Texas
marcoroth
0
190
すこし踏み込む CancellationToken
htkym
2
1.6k
Augmenting AI with the Power of Jakarta EE
ivargrimstad
0
490
なぜCTOを降りてFDEを選んだのか?〜なぜプロダクト企業がFDEで顧客の現場に踏み込むのか〜
gonta
1
160
ジョジョの世界をXRで再現する
mofurune
0
140
大喜利で理解するLLM as a Judge / Understanding LLM-as-a-Judge through Ogiri
rockname
0
190
見えないものを探る要求要件定義に必要な基本的思考 / invisible-requirement-thinking
minodriven
15
7.9k
[2026-09-26]空論ジェネリックプロセス~テスト資産とAIで紡ぐ、再現可能なパフォーマンスチューニングの話~
tosite
0
260
Workers Cache を知る
syumai
0
340
Ghostty + Neovimで作る 透明でカッコ良い開発環境
j341nono
0
150
Featured
See All Featured
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
230
23k
Digital Projects Gone Horribly Wrong (And the UX Pros Who Still Save the Day) - Dean Schuster
uxyall
1
3.3k
Embracing the Ebb and Flow
colly
88
5.2k
Deep Space Network (abreviated)
tonyrice
0
360
The AI Revolution Will Not Be Monopolized: How open-source beats economies of scale, even for LLMs
inesmontani
PRO
3
3.8k
Chasing Engaging Ingredients in Design
codingconduct
0
350
Art, The Web, and Tiny UX
lynnandtonic
304
22k
Build The Right Thing And Hit Your Dates
maggiecrowley
39
3.5k
Test your architecture with Archunit
thirion
2
2.4k
[SF Ruby Conf 2025] Rails X
palkan
3
1.4k
Code Reviewing Like a Champion
maltzj
529
40k
How to make the Groovebox
asonas
2
2.5k
Transcript
ϚΠΫϩαʔϏε #hatenaintern
☪仼סإ٭ٜ ˝ ם؆כםׂُؕؠٞئ٭لتֿלַֹֹס־־ ˝ ُؕؠٞئ٭لتס榫鏤סꦬ㍱妳־
☪仼ס⫂㳊 ˝ ُؕؠٞئ٭لتכע ˝ ٓؿٛت ˝ עיםמֽُׄؕؠٞئ٭لت ˝ ُؕؠٞئ٭لتס⮆Ⱏ亠嫎 ˝
ُؕؠٞئ٭لتסوٚؠطؔت ˝ ئ٭لتْشبٖ ˝ ױכ״
ֽ鎇םַ׆כ golang
ُؕؠٞئ٭لت ُؕؠٞئ٭لتכע
ُؕؠٞئ٭لت +
ُؕؠٞئ٭لت +
אאئ٭لتכע service a system that provides something that the public
needs, organized by the government or a private company Hatena REMOTE INTERNSHIP / ( ?)
ُؕؠٞئ٭لتכע + https://martinfowler.com/articles/microservices.html 2014 DDD( )
هٞءמכ׆סُؕؠٞئ٭لت 1 HTTP API - https://martinfowler.com/articles/microservices.html
ُؕؠٞئ٭لت REST API GraphQL gRPC... /
ةؘن٬يدتס䫍 2002 Amazon 1. ئ٭لتؕ٤ذ٭نؘ٭ت鵟י⪒יסظ٭ذכ嚀耆⪜ꝧ 2. אסؕ٤ذ٭نؘ٭ت鵟י鵟⟓םׄףםםַ 3. ؾشع٠٭ؠ飈סئ٭لتؕ٤ذ٭نؘ٭ت磬榺ג鵟⟓דֿׄ錉⺎ն 4.
✳榫䤗软עゖםַ HTTP Corba Pubsub ⛰ך荁ַ Bezos 5. Steve Yegge Google
ُؕؠٞئ٭لتס荁ַכ׆ API
ُؕؠٞئ٭لتס荁ַכ׆ ˝ 邾丗סؓوٛآ٭ب٘٤ך⺱⭚杼㲔逷䑒釐ֿםׂם ˝ ❆ֻף鵟湳ُؕؠٞئ٭لتכյ二ַؓوٛآ٭ب٘ ٤ךעאסُؕؠٞئ٭لتסٛؠؙتعדׄך鵟湳ֿך׀ ˝ ٚؕهٚٛך⺱׆כֿ⺎耆כַֻף⺎耆דֿյ銧鏤窜םל ֿ㰆㏇םַסֿَؕ٤ع ˝
ُؕؠٞئ٭لتׇכמز٭ّ⮉׆כֿך׀ ˝ 鵟湳םלْ٤طػ٤ت㓹泅ز٭ّםל
ُؕؠٞئ٭لتסחַכ׆ 1 web 2 20 ⾒ ⾒
ם僃鲣孱车זיַ־ ProtocolBu er gRPC GraphQL OpenAPI /
עיםכُؕؠٞئ٭لت ˝ עיםךُؕؠٞئ٭لت⮵榫יַױ ˝ 鐐ꄋئ٭لت ˝ هٞءذء ˝ 嚀危㰢綗 ˝
ز٭ّꝴךסظ٭ذס ˝ ؓوٛآ٭ب٘٤ُؕؠٞئ٭لتדׄך啶䡗יַכַֹյ釐碛釐碛ُ ؕؠٞئ٭لتיַ ˝ ؓوٛآ٭ب٘٤舅⛮עٓؿٛت┊㴩מ鷞榫יַ◄ֿ㛡ַ
ٓؿٛت ( ) 1 .... WAF(WebApplicationFramework)
ٓؿٛت 1 1 1 1 DB DB
ٓؿٛت 1 DB
vs CI/CD 2
1 1
ُؕؠٞئ٭لتס睦䈱 ? No /
㗞槡טׄגؤ٤ط؞تع DDD DB
磵⺬ꄆ邾 / ...
ُؕؠٞئ٭لتכظ٭ذ畘杼 ˝ ظ٭ذي٭ت┕סظ٭ذյُؕؠٞئ٭لتׇכמ斻玮י䧏ח׀ ˝ ظ٭ذي٭ت⪦僗כյ㗞槡טׄגؤ٤ط؞تعכַֹ䙫⽏ךֵױ荁ׂםַ ˝ ظ٭ذي٭ت邾丗סُؕؠٞئ٭لتך⪦僗כյظ٭ذي٭تֿ磵㷀ⶡ┉꤃㲹憠 מם ˝ ت؞٭ُ⪦僗יַג㕙⺬յֵئ٭لتך㚺催ⱶֻכ☽ئ٭لت㚺催מ鴑
䏼䑒釐ֵֿ ˝ ُؕؠٞئ٭لتׇכמ鸵⮉םظ٭ذي٭ت鹟䥃ך׀⮵憠ֵ ˝ ج؞ٖٛطؔ鈝憠鵭䈱鈝憠םלյ喋չ
ُؕؠٞئ٭لتכظ٭ذ畘杼
? No API GateWay API PC API API DB DB
1
ئ٭لتي٭تؓ٭؞طؠزٔ DB DB
ُؕؠٞئ٭لتס⮆Ⱏ
ُؕؠٞئ٭لتס⮆Ⱏ ˝ ُؕؠٞئ٭لت⛼זיַׂ꤀ע䑒յُؕؠٞئ٭لتס 鞊ⳉ婊㲊⛼哅ֿ䑒釐מם ˝ ُؕؠٞئ٭لتס⮆Ⱏ ˝ ⪮⛮氳ם⮆Ⱏ亠嫎釤⯥מյُؕؠٞئ٭لتס⯥䬠䤰ֻ יֽ׀ױֹ
ُؕؠٞئ٭لتס⯥䬠 DB
8 Fallacies of distributed computing ( 8 / ) -
1994 1. 2. 3. 4. 5. 6. 1 7. 8.
⺎鈝峮䓪 web / (Observability)
⺎鈝峮䓪 mackerel
ُؕؠٞئ٭لتס⮆Ⱏ ُؕؠٞئ٭لتס⮆Ⱏע荇չ孱孬ֿ㰆㏇ .... - - 僃鲣ךע⮆Ⱏ䣆Ⲃׄص٭ٜםלֿꝧ氦חחֵ
哅ⳉמ⮆Ⱏ ˝ 鏀錞 ˝ よ⿁辐炐٬吾碟 ˝ 鐐ꄋ ˝ ㏇䈻澬鏀 ˝
⭳蕔⛼哅 ˝ 鑁姲
哅ⳉמ⮆Ⱏ ˝ ٗ٭ا٭ֿאא樟ם㗞槡 ˝ ٗ٭ا٭ע⺱דֿյ姲״סֿ樟ם㗞槡
哅ⳉמ⮆Ⱏ /
㗞槡טׄגؤ٤ط؞تعמ⮆Ⱏ DDD DDD DDD
㗞槡טׄגؤ٤ط؞تعמ⮆Ⱏ (Entity Trap) - - - - DB ORM
ؕطٝ٭طؔهמ䷉ャ 1
攐䓪מ⮆Ⱏ / ( ) 1 (Availability) (Continuity) (Performance) / /
攐䓪מ⮆Ⱏ ײׂמُؕؠٞئ٭لت縒ֻ⯥מյױע㵚霄סئ٭لت⮆冪յלסֹםغْؕ ٤⣐ꪫֵֿ־釤哕״ױֹ /
❆ֻףج؞ٖٛطؔ ˝ ج؞ٖٛطؔמꄆ釐םظ٭ذ䣽ֹסעئ٭لتכי⮉ ⭳ױֹ ˝ 斻玮גظ٭ذي٭ت ˝ ❆ֻף鵟䅻סئ٭لتכ鐐ꄋئ٭لت⮆ꦕםל ˝ ⮯סئ٭لتכס鵟⟓ס倊⺘吾鋀ױֹ
❆ֻף⫋⮵榫䓪 ˝ ؓؗ٤ع㓹泅鵟湳յ婊岷嚀耆םל ˝ ⺱ؓؗ٤عך邾丗סئؕعמٞءؕ٤גַ ˝ 婊岷嚀耆ע䄄丗ֿ־־סךյُؕؠٞئ٭لتי⪦鵟 㓹泅מיֽ׀גַ ˝ 邾丗סئ٭لتך⮵榫ך׀־לֹ־
ُؕؠٞئ٭لتס⮆Ⱏ ˝ 釤י׀ג喋מُؕؠٞئ٭لتס⮆Ⱏ縒ֻכ׆ךע喋չ ם鈝憠ֵֿ ˝ 塜鉮ֿ扛ַ┩槡םסךյ喋չםססعٝ٭غ؛ن縒䜡ם ֿ錃銶ֹ ˝ 僃䖾ם錃銶ך扛ׄףؕطٝ٭طؔهמ䷉ャ◄ֿך׀ ˝
☽ס⣐ꪫכיظ٭ذס䣽ַמ浓泘׆כֵ
ُؕؠٞئ٭لتסوٚؠطؔت ˝ ُؕؠٞئ٭لتמֽׄظ٭ذס䣽ַ ˝ ئ٭لتꝴ鵟⟓ ˝ ئ٭لتْشبٖ ˝ ُؕؠٞئ٭لتסٛٛ٭تכٛنؒؠذٛ٤ء
ُؕؠٞئ٭لتמֽׄظ٭ذס䣽ַ
DB 1 1 DB to DB
CAP BASE 3 2 C: Consistency ( ) A: Availability
( P: Tolerance to network Partitions ( ) ( )CAP BASE Basically Available( ) Soft state( ) Eventually consistent( )
ُؕؠٞئ٭لتכ⮆丆عٚ٤اؠب٘٤ ! ئ٭لتױג׃عٚ٤اؠب٘٤עםַ 1
אך⮆丆عٚ٤اؠب٘٤גַ 2 Saga TCC
Saga T , T , T C , C ,
C :
Saga : AWS https://docs.aws.amazon.com/ja_jp/prescriptive-guidance/ latest/modernization-data-persistence/saga-pattern.html
TCC Try/Con rm/Cancel ײ؆ם荁ׄף⟊㰆յ鐍־ד״ם؞ٔ٤جٜ
TCC Try Cancel Try Con rm Con rm Cancel
TCC ˝ אבסئ٭لتמ◅㍑חٛؠؙتعֿ䑒釐 ˝ ع٭ذٜך侇ꝴֿ־־׆כֿؾشؠ
DB ? ... ADR
睦䈱縒ֻ泡גֹֿ荁ַ侇 1 1
ئ٭لتꝴ鵟⟓
ئ٭لتꝴ鵟⟓ schema rst
⫴璡䓪 1 1 1 /payment {"amount":300, "userAccount": "hoge"} /payment ID
/payment {"amount":300, "userAccount": "hoge","forPurchase": "abcd123"} forPurchase forPurchase
ئ٭لتْشبٖ
ُؕؠٞئ٭لتס畘杼 ˝ ؓوٛآ٭ب٘٤ע邾ꥭםئ٭لت紮סױ ˝ ؓوٛآ٭ب٘٤⟥渏י釤亠嫎ֿ培ַ ˝ ئ٭لتꝴס❣㰆꞊➟ ˝ 泃釱٬ٞءס⹜ ˝
ئؕغ٭قذ٭٤ֿ㛡ׂ⮵榫
ُؕؠٞئ٭لتס畘杼 ˝ ꤃㲹氦榟侇ס鐧削 ˝ ⠕չסئ٭لتꯂ樑מ釤יַׂכ侇ꝴֿ־־ ˝ ئ٭لتꝴס鵟⟓畘杼♓┕מ׆כֵֿאֹ
ئؕغ٭قذ٭٤ mackerel-container-agent
ئ٭لتْشبٖ proxy proxy ip
ئ٭لتْشبٖס䏔Ⱏ A B
ئ٭؞شعهٝ٭٭ Istio
ظ٭ذوٝ٭٤כؤ٤عٞ٭ٜوٝ٭٤ ˝ ظ٭ذوٝ٭٤ ˝ ⺨ئ٭لتמ㳝岣זיⳂׂوٞ؞ب ˝ 鵟⟓ס⯆䐒כ䗯㕔ס⹜ ˝ ىٜتزؘشؠ鏀錞٬鏀⺎םל车ֹ ˝
ْعٛشؠٞء⹜յؤ٤عٞ٭ٜوٝ٭٤峚
ظ٭ذوٝ٭٤כؤ٤عٞ٭ٜوٝ٭٤ ˝ ؤ٤عٞ٭ٜوٝ٭٤ ˝ ظ٭ذوٝ٭٤סؕ٤تذ٤تס畘杼 ˝ ⺨ئ٭لتסْعٛشؠٞء⹜ ˝ 啶䡗畘杼٬⺨牊رشبٍٖ٭غ
Envoy https://www.envoyproxy.io/ Lyft C++ L L HTTP HTTP, gRPC, WebSocket,
TCP ( )
Istio Istiod sidecar injection Envoy Envoy
ُؕؠٞئ٭لتסٛٛ٭ت亠嫎 API versioning / API
壿꣪氳מت؞٭ُסٛنؒؠذٛ٤ء GraphQL gRPC
催מ㰢שמע CloudNative CNCF Cloud Native Interactive Landscape The Amazon Builders'
Library microservice microservice - . oO( ( l _ l) ) Sam Newman 2016 Susan J. Fowler 2017 Neal Ford, Rebecca Parsons, Patrick Kua 2018 Sam Newman 2020 Microservice Architecture
ױכ״ ˝ ُؕؠٞئ٭لتע邾丗סئ٭لتֿ鵟⟓מזי鵽䯥י䡗 玮חؓ٭؞طؠزٔ ˝ ُؕؠٞئ٭لتס⮆Ⱏ亠嫎ע喋չם䣆嫎ֵֿ ˝ ُؕؠٞئ٭لتעؕطٝ٭طؔهמ䷉ャ禈ׄ׆כֿꄆ釐 ˝ ئ٭لتْشبٖםלסوٚؠطؔت⪌יַ׆ֹ
זיײֹסؤ٭ػ٭
: Istio istioctl install istioctl install !"set profile=demo !"context hatena-intern-2021
kubectl label namespace hatena-intern-2021 istio- injection=enabled kubectl get namespace hatena-intern-2021 -o yaml istio-injection enabled
: Istio kubectl apply -f https:!"raw.githubusercontent.com/istio/ istio/release-1.7/samples/addons/kiali.yaml Kiali kubectl apply
-f https:!"raw.githubusercontent.com/istio/ istio/release-1.7/samples/addons/prometheus.yaml Prometheus application istioctl dashboard kiali sign in admin:admin
Kiali
: fault injection 攐㲊ס嚀耆מ䙫㍲氳מ䷚꤃氦榟י䏅ꮶ疗㍱鐧ױ Injecting an HTTP abort fault renderer
service ( Service Temporarily Unavailable) fault %age Kiali application blog service error message istio-proxy log "authority": "renderer-go:50051" response_flags
: fault injection renderer service response 5 Kiali application istio-proxy
log response_flags kubectl delete virtualservices.networking.istio.io [໊લ] fault injection