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
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
130
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
960
Other Decks in Programming
See All in Programming
アクセシビリティから考える情報設計
high_g_engineer
0
380
新卒PdEのリアル
ryu1013
1
500
Vue Fes Japan 2026 タイムテーブル徹底解説
448jp
1
220
Are APIs Still Relevant in the AI Era?
soyuka
0
230
iOSDC Japan 2026 - Swiftで作って学ぼう!データベース自作入門
kaseken
2
170
Augmenting AI with the Power of Jakarta EE
ivargrimstad
0
110
C#の現在地 進化の歴史と、AI時代の.NET Everywhere
neuecc
4
2k
Starting & Sustaining Code-Based E2E Testing for Non-Coding QA Teams( #jasstniigata )
teyamagu
PRO
1
320
更なる可用性を求めて、5年間運用したKotlinのアプリケーションをGoでリプレイスする話
ken_tunc
0
270
XHTMLが残したもの
yosuke_furukawa
PRO
2
810
海上で動くGoサーバー: goroutineとchannelでさばく航行データストリーム
atsuki_seo
0
720
AI活用は、個人から組織へ|マルチプレイヤーエージェントハーネス「QM」の社内活用事例 / AI use is moving from individuals to orgs
rkaga
1
110
Featured
See All Featured
Abbi's Birthday
coloredviolet
4
10k
Agile Actions for Facilitating Distributed Teams - ADO2019
mkilby
0
280
The SEO identity crisis: Don't let AI make you average
varn
0
560
Self-Hosted WebAssembly Runtime for Runtime-Neutral Checkpoint/Restore in Edge–Cloud Continuum
chikuwait
0
810
SEO in 2025: How to Prepare for the Future of Search
ipullrank
3
3.8k
The Illustrated Children's Guide to Kubernetes
chrisshort
51
53k
GitHub's CSS Performance
jonrohan
1033
470k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
46
3k
How To Speak Unicorn (iThemes Webinar)
marktimemedia
1
580
Are puppies a ranking factor?
jonoalderson
2
3.9k
Leading Effective Engineering Teams in the AI Era
addyosmani
9
2.6k
The AI Revolution Will Not Be Monopolized: How open-source beats economies of scale, even for LLMs
inesmontani
PRO
3
3.7k
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