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
140
60分で学ぶクラウドとSRE・サービス運用 / GeekCAMPAcademia 2026-05
hatena
1
110
エンジニアリング マネージャーの育成と評価軸の考え方
hatena
0
690
Perlブートキャンプ
hatena
0
5.3k
はてなサマーインターンシップ2025 Web API 講義資料
hatena
0
1.7k
はてなサマーインターンシップ2025 フロントエンド 講義資料
hatena
21
11k
はてなサマーインターンシップ2025 コンテナ + Kubernetesハンズオン 講義資料
hatena
0
830
はてなサマーインターンシップ2025 クラウドと運用 講義資料
hatena
0
870
はてなサマーインターンシップ2025 RDBMSの基礎 講義資料
hatena
0
970
Other Decks in Programming
See All in Programming
C#の現在地 進化の歴史と、AI時代の.NET Everywhere
neuecc
4
3.2k
世界の中心で、AI(App Intents)をさけぶ ー App Intents中心設計の実践ガイド
touyou
0
640
スマート反転とウェブアクセシビリティ
camiha
0
210
速習iPhone Duo対応
yuukiw00w
1
710
Intent as Code
shoppingjaws
6
1.1k
モデルのリファクタリングが難しいと思ったら、そもそも複雑だったのはビジネス仕様だった ? / is-the-business-domain-the-real-complexity
hatsu38
0
380
更なる可用性を求めて、5年間運用したKotlinのアプリケーションをGoでリプレイスする話
ken_tunc
0
330
What We Talk About When We Talk About XP
m_seki
2
670
thread_parallel_with_free-threaded_Python_and_NumPy.pdf
riku_sakamoto
0
350
Vue Fes Japan 2026 タイムテーブル徹底解説
448jp
1
460
選挙速報を多くのユーザーへ 届ける Live Activities 設計
hamayokokuririn
0
150
Omarchy Tokyo やると聞いて UMPC 買ってセットアップしてきた
mtsmfm
0
150
Featured
See All Featured
技術選定の審美眼(2025年版) / Understanding the Spiral of Technologies 2025 edition
twada
PRO
120
120k
Building a A Zero-Code AI SEO Workflow
portentint
PRO
0
730
The Illustrated Children's Guide to Kubernetes
chrisshort
51
53k
Designing for Performance
lara
611
70k
How People are Using Generative and Agentic AI to Supercharge Their Products, Projects, Services and Value Streams Today
helenjbeal
1
330
Groundhog Day: Seeking Process in Gaming for Health
codingconduct
0
360
職位にかかわらず全員がリーダーシップを発揮するチーム作り / Building a team where everyone can demonstrate leadership regardless of position
madoxten
69
65k
Have SEOs Ruined the Internet? - User Awareness of SEO in 2025
akashhashmi
0
500
The Director’s Chair: Orchestrating AI for Truly Effective Learning
tmiket
1
300
How to Grow Your eCommerce with AI & Automation
katarinadahlin
PRO
2
280
A Tale of Four Properties
chriscoyier
163
24k
Facilitating Awesome Meetings
lara
57
7.1k
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