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
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
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
The kernel report
ennael
PRO
1
230
VS Code × GitHub Copilot での Fabric 開発
ryomaru0825
1
260
OSC2026on_the-world-is-waiting-for-your-voice.pdf
naruoga
0
330
AI Made Us Faster at Solving the Wrong Problems
marceloancelmo
0
160
ミイダス株式会社 テックチームのご紹介 / MIIDAS Tech Team
miidas
0
120
Incremental HTTP
kazuho
5
2k
プラットフォームを「作る」、 チームに「入り込む」
sansantech
PRO
0
700
個別開発で終わらせない。 現場の課題をプロダクトの強さに変える StockmarkのFDE
ktkrhr
0
570
Claude起点の仕様駆動開発
tanakaseiya
0
340
データ品質を壊しながらSnowflakeのAIに分析させてみた
kawanago
0
470
サーバーフルコンピューティング?AWS Lambda
iwatatomoya
1
220
AI駆動開発、viviONの1年 ── うまくいったこと・いかなかったこと
vivion
0
150
Featured
See All Featured
Un-Boring Meetings
codingconduct
0
440
Leading Effective Engineering Teams in the AI Era
addyosmani
9
2.7k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
234
18k
Marketing to machines
jonoalderson
1
5.8k
Exploring anti-patterns in Rails
aemeredith
4
520
Unlocking the hidden potential of vector embeddings in international SEO
frankvandijk
0
970
The Limits of Empathy - UXLibs8
cassininazir
1
700
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
360
31k
VelocityConf: Rendering Performance Case Studies
addyosmani
331
25k
AI Search: Where Are We & What Can We Do About It?
aleyda
0
8k
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
10
1.4k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
141
35k
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