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
なぜ Go はマイクロサービスのための言語なのか - Why Go is a language...
Search
Kohei
July 13, 2019
Technology
8.3k
11
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
なぜ Go はマイクロサービスのための言語なのか - Why Go is a language for microservices
Kohei
July 13, 2019
More Decks by Kohei
See All by Kohei
Cacoo with Microservices
cohhei
0
2k
Other Decks in Technology
See All in Technology
"優秀な誰か"の下位互換にならないために
yut0naga1_fa
0
490
MCPゲートウェイを作って運用してわかったこと — Agent時代の権限管理の現在地
mtpooh
10
3.2k
オンラインゲームのシステム全体像 - コロプラ 2026年度 新卒研修
colopl
0
990
自律型 AI をセキュアに実装!Gemini と MIG で作る動的コード実行環境
recruitengineers
PRO
1
230
LLM機能を自作して分かるSnowflake Cortex AIの強み
nayuts
0
330
Essential architectural thinking (revised edition)
ufried
0
110
More Freedom on the Same Shared GPU Cluster: A Small Team’s Experience with vCluster
nttcom
0
140
AI 時代の Azure エンジニアリング ~ 私たちは何を磨き、何を任せるのか ~
chack411
1
540
AI駆動開発の時代になったのでトヨタ生産方式から見直す
terurou
5
5.4k
ブラウザとサーバーから考えるAI時代のフロントエンド監視
shogo4131
2
590
AI駆動開発、viviONの1年 ── うまくいったこと・いかなかったこと
vivion
0
270
DWH の限界突破! AI エージェント向け爆速リアルタイムデータ基盤 ClickHouse
jozono
1
310
Featured
See All Featured
Designing Dashboards & Data Visualisations in Web Apps
destraynor
232
55k
Context Engineering - Making Every Token Count
addyosmani
9
1.2k
WCS-LA-2024
lcolladotor
0
860
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
287
14k
VelocityConf: Rendering Performance Case Studies
addyosmani
331
25k
Paper Plane (Part 1)
katiecoart
PRO
2
11k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
35
2.9k
Optimizing for Happiness
mojombo
378
71k
AI: The stuff that nobody shows you
jnunemaker
PRO
10
1.1k
The Illustrated Children's Guide to Kubernetes
chrisshort
51
53k
Building Better People: How to give real-time feedback that sticks.
wjessup
370
20k
[Rails World 2026] Durable orchestration on Rails: from continuation to workflow
palkan
1
510
Transcript
ͳͥ Go ϚΠΫϩαʔϏεͷͨΊͷݴޠͳͷ͔ Kohei Kimura Software Engineer at Nulab Inc.
@cohhei
☝ࠓҰ൪ݴ͍͍ͨ͜ͱ☝
εϙϯαʔηογϣϯͰ ͋Γ·ͤΜ ※ͪΌΜͱϓϩϙʔβϧॻ͖·ͨ͠ɻ΄Ίͯɻ
SIerɺࠃΫϥυϕϯμʔΛܦͯ20181݄ Nulab ೖࣾ Cacoo νʔϜͷόοΫΤϯυΤϯδχΞ ։ൃݴޠ ΄΅ ≡, ·Εʹ Java,
Node.js ొஃ࣮ Kubernetes Meetup Tokyo #14 CloudNative Days Fukuoka 2019 AWS Summit Osaka Kohei Kimura @cohhei
ΫϥυωΠςΟϒͬͯ·͔͢ʁ
ΫϥυωΠςΟϒͱ εέʔϥϒϧͳΞϓϦέʔγϣϯΛߏங͓Αͼ࣮ߦ͢ΔͨΊͷٕज़ͷ૯শ දతͳٕज़: ίϯςφɺαʔϏεϝογϡɺϚΠΫϩαʔϏεɺ ΠϛϡʔλϒϧΠϯϑϥετϥΫνϟɺએݴܕAPI ճ෮ੑʢresilientʣɺཧ͢͠͞ʢmanageableʣɺՄ؍ଌੑ ʢobservableʣ͕ಘΒΕΔ
ίϯςφɺCI/CDɺΦʔέετϨʔ γϣϯ… ͑ɺαʔϏεϓϩΩγɾϝογϡɾ σΟεΧόϦʔͰͬͱʁ ಓͷΓ͍…
None
ΫϥυωΠςΟϒপ
https://www.youtube.com/watch?v=1qVj1vXbuX0 ෳࡶɺ ॲཧͷݪ࢝ੑɺҰ؏ੑͷ͠͞ ཧίετͷ૿େ
ࠓͷɿ ͍͍ͧ
None
Go ͕ Google Ͱੜ·ΕͨܦҢ ແͷϋʔυΣΞɺແͷιϑτΣΞ Լ͕Γଓ͚Δ։ൃޮʹର߅͢Δ
"Go was designed by and for people who write —and
read and debug and maintain—large software systems." Rob Pike, Go at Google
ͳͥ Go ϚΠΫϩαʔϏεͷͨΊͷݴޠͳͷ͔ https://blog.docker.com/2019/02/weve-got-❤%EF%B8%8F-for-our-first-batch-of-dockercon-speakers/ ཧ༝: ΫϥυωΠςΟϒͱͷ ૬ੑ͕ʮΓΑ͔ʯ γϯάϧόΠφϦɺߴͳϏϧυɺলϝϞϦ
Docker and Go
FROM golang:1.7.3 WORKDIR /go/src/github.com/alexellis/href-counter/ RUN go get -d -v golang.org/x/net/html
COPY app.go . RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o app . FROM alpine:latest RUN apk --no-cache add ca-certificates WORKDIR /root/ COPY --from=0 /go/src/github.com/alexellis/href-counter/app . CMD ["./app"] ΈΜͳ͍͖ͩ͢ multi-stage builds
FROM golang:1.7.3 WORKDIR /go/src/github.com/alexellis/href-counter/ RUN go get -d -v golang.org/x/net/html
COPY app.go . RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o app . FROM alpine:latest RUN apk --no-cache add ca-certificates WORKDIR /root/ COPY --from=0 /go/src/github.com/alexellis/href-counter/app . CMD ["./app"] ΈΜͳ͍͖ͩ͢ multi-stage builds Ϗϧυ༻ͷεςʔδ
FROM golang:1.7.3 WORKDIR /go/src/github.com/alexellis/href-counter/ RUN go get -d -v golang.org/x/net/html
COPY app.go . RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o app . FROM alpine:latest RUN apk --no-cache add ca-certificates WORKDIR /root/ COPY --from=0 /go/src/github.com/alexellis/href-counter/app . CMD ["./app"] ΈΜͳ͍͖ͩ͢ multi-stage builds ࣮ߦ༻ͷεςʔδ Go Πϯετʔϧ͞Ε͍ͯͳ͍ Ϗϧυ༻ͷεςʔδ͔Β ϑΝΠϧΛίϐʔ
Observability and Go
Clients Server Side ࡶͳ Microservices Ͳ͜ͰԿ͕͓͖ͯΔ͔ Θ͔Βͳ͍
Observability Metrics Trasing Logging
None
Ұ൪͡Ίʹ͖ͯΔ͎ʙʂ (” ՞ਊ ՞)”řŐŖŘ!!
https://zipkin.apache.org
Observability Metrics Trasing Logging
None
https://prometheus.io/
(” ՞ਊ ՞)”řŐŖŘ!! https://prometheus.io/
https://prometheus.io/docs/guides/go-application/
ʢΞϓϦଆʣಋೖ͕؆୯ Έ͕Ͱ͖ΕՃɾߋ৽ൺֱత؆୯ πʔϧΛऔΓೖΕΔ͜ͱͰϕετϓϥΫςΟεΛ ͱΓ͜Ή
gRPC and Go
ΦʔϓϯιʔεͷRPCϑϨʔϜϫʔΫ RPC = Remote Procedure Call ΠϯλʔϑΣʔεΛ Protocol Buffers Ͱࣗಈੜ
ҟͳΔݴޠͰ༻Մೳ HTTP/2 ํετϦʔϛϯά
Protocol Buffers Ͱఆٛ → ίʔυੜΛ࣮ߦ → ΫϥΠΞϯτͱαʔόʔͷΠϯλʔ ϑΣʔεɺܕͷίʔυ͕ੜ
ৄ͘͠ @vvvatanabe ʹฉ͍͍ͯͩ͘͞
ʹ͓͚Δ Proto ϑΝΠϧͱੜͨ͠ίʔυͷཧ
Protofiles Git repositories Generated code Generate Webhook git push origin
develop/ beta/master Protocol Buffers ϑΝΠϧ୯ҰͷϦϙδτϦͰཧ ϑΝΠϧ͕ߋ৽͞ΕΔͱ → Jenkins ্Ͱ Java ͱ Go ͷίʔυੜ → ଞϓϩδΣΫτ dep ensure ͳͲͰऔಘ Protofilesͱੜ͞ΕͨίʔυͷϒϥϯνҰக Other applications Generated code
·ͱΊ
͍͍ͧ
͍͍ͧ ͍͞͝ʹ
Diagram ΦϯϥΠϯ௨͠ͳ͕Βڞಉฤू ͦͷͰࢿྉ࡞ ը໘ڞ༗ෆཁ ݴޠͰΘΓʹ͍͘͜ͱਤͰઆ໌
͝ਗ਼ௌ͋Γ͕ͱ͏͍͟͝·ͨ͠ɻ ݟ͔͚ͨΒ͔͚͍ͯͩ͘͞ɻ Kohei Kimura Software Engineer at Nulab Inc. @cohhei