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
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
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
SREは、MCPとAutopilotをこう使え!
kazumax55
3
910
顧客に向き合う開発組織へ。リアーキテクチャとフィーチャーチーム化で挑む組織改革
safie
0
2.1k
Reactの設計論
uhyo
24
14k
Goodbye ShellScript, Hello File-based App
shunsock
0
400
Claude in Chrome 入門 / Introduction to Claude in Chrome
cielo1985
0
870
AIによるクリエイティブ生成を行う上での試行錯誤
plaidtech
PRO
0
160
beyond jj: config & tools ecosystem
indirect
0
5.4k
ソフトウェアDNAとクラウドエージェントのススメ
cloudace
0
120
人間はどの意思決定を手放せるのか
kawasima
15
7.5k
アクセスキーこわい やめかたと漏らさない工夫
sassssan68
1
500
AI時代、データエンジニアが一番おもろい
genshun9
0
670
事業課題から技術的負債に向き合う
sansantech
PRO
2
2k
Featured
See All Featured
Dominate Local Search Results - an insider guide to GBP, reviews, and Local SEO
greggifford
PRO
0
330
State of Search Keynote: SEO is Dead Long Live SEO
ryanjones
0
280
Groundhog Day: Seeking Process in Gaming for Health
codingconduct
0
360
The Illustrated Children's Guide to Kubernetes
chrisshort
51
53k
Java REST API Framework Comparison - PWX 2021
mraible
34
9.7k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
PRO
203
76k
How to Think Like a Performance Engineer
csswizardry
28
2.8k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
360
30k
How Software Deployment tools have changed in the past 20 years
geshan
1
34k
How to make the Groovebox
asonas
2
2.4k
Bash Introduction
62gerente
615
220k
Why Our Code Smells
bkeepers
PRO
340
58k
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