Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Microservice with go and gRPC
Search
Eunju Amy Sohn
November 05, 2018
Programming
1
560
Microservice with go and gRPC
2018 GDG DevFest - go와 gRPC로 함께하는 마이크로서비스
Eunju Amy Sohn
November 05, 2018
Tweet
Share
More Decks by Eunju Amy Sohn
See All by Eunju Amy Sohn
내가 커뮤니티 스피킹을 하는 이유
ejsohn
1
370
Cloud Deep Learning for everyone
ejsohn
0
150
Spot Utilization for GPU Instance Cost Efficiency
ejsohn
0
87
40만명이 쓰는 Django channels 채팅서버, 우리는 어떻게 만들었나?
ejsohn
1
2.4k
Implementing Reactive Programming with ReSwift
ejsohn
0
180
Other Decks in Programming
See All in Programming
.NETでOBS Studio操作してみたけど…… / Operating OBS Studio by .NET
skasweb
0
130
EC2からECSへ 念願のコンテナ移行と巨大レガシーPHPアプリケーションの再構築
sumiyae
3
610
Flatt Security XSS Challenge 解答・解説
flatt_security
0
790
HTML/CSS超絶浅い説明
yuki0329
0
200
Azure AI Foundryのご紹介
qt_luigi
1
240
どうして手を動かすよりもチーム内のコードレビューを優先するべきなのか
okashoi
3
940
チームの立て直し施策をGoogleの 『効果的なチーム』と見比べてみた
maroon8021
0
150
React 19でお手軽にCSS-in-JSを自作する
yukukotani
5
590
GitHub CopilotでTypeScriptの コード生成するワザップ
starfish719
28
6.1k
asdf-ecspresso作って 友達が増えた話 / Fujiwara Tech Conference 2025
koluku
0
1.5k
PHPUnitしか使ってこなかった 一般PHPerがPestに乗り換えた実録
mashirou1234
0
450
ASP.NET Core の OpenAPIサポート
h455h1
0
150
Featured
See All Featured
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
45
2.3k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
28
9.2k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
232
17k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
98
18k
Reflections from 52 weeks, 52 projects
jeffersonlam
348
20k
GraphQLの誤解/rethinking-graphql
sonatard
68
10k
4 Signs Your Business is Dying
shpigford
182
22k
Gamification - CAS2011
davidbonilla
80
5.1k
The Pragmatic Product Professional
lauravandoore
32
6.4k
How to train your dragon (web standard)
notwaldorf
89
5.8k
Producing Creativity
orderedlist
PRO
343
39k
Imperfection Machines: The Place of Print at Facebook
scottboms
267
13k
Transcript
, / EJSohn Korea go gRPC
- - - - - Korea
- go - REST .. gRPC ..? - gRPC -
- Korea
- What is gRPC? - Let s make it! (a.k.a
coding time) - gRPC features - Why Microservice? - Summary Korea
What is gRPC? Korea
gRPC Users
History of Server - Client communication Socket RPC CORBA DCOM
SOAP REST RMI 1983~ 1980s~1990s 1998~ 1999~ ~ ~ ~
History of Server - Client communication Socket RPC CORBA DCOM
SOAP REST RMI 1983~ 1980s~1990s 1998~ 1999~ ~ ~ ~ ?
History of Server - Client communication Socket RPC CORBA DCOM
SOAP REST RMI 1983~ 1980s~1990s 1998~ 1999~ ~ ~ ~ Socket .
History of Server - Client communication RPC (Remote Procedure Call)
• RPC • . • .
History of Server - Client communication Socket RPC CORBA DCOM
SOAP REST RMI 1983~ 1980s~1990s 1998~ 1999~ ~ ~ ~ RPC .. !
History of Server - Client communication Socket RPC CORBA DCOM
SOAP REST RMI 1983~ 1980s~1990s 1998~ 1999~ ~ ~ ~ HTTP . SOAP - XML REST - ( )JSON
History of Server - Client communication Socket RPC CORBA DCOM
SOAP REST RMI 1983~ 1980s~1990s 1998~ 1999~ ~ ~ ~ HTTP . SOAP - XML REST - ( )JSON
History of Server - Client communication gRPC (google Remote Procedure
Call) Stubby RPC Stubby
How it works gRPC • Stub • IDL (Interface Description
Language) • Protocol Buffers
How it works? RPC - Stub • . • Polyglot
programming
How it works gRPC • Stub • IDL (Interface Description
Language) - - Stub • Protocol Buffers
How it works gRPC • Stub • IDL (Interface Description
Language) • Protocol Buffers - (serialization) - IDL stub service interface code
How it works gRPC
None
None
gRPC service outline API - Unary RPC Model (User) -
name, age, cache API - cache - cache User Server lang - go Client lang - python
Go • google • Docker, Kubernetes, Packer • • gRPC
gRPC tool ( https:// github.com/grpc-ecosystem/ awesome-grpc )
api.proto file
Proto3 Protocol buffers language Version: proto2(default) & proto3 Service Message
type Service field type generally scalar, enum or other message types filed number message .
api.proto file Version Service Message Field type Field number
Protocol Buffers stub, service interface code • protoc • .proto
service interface code =
. go / python
- go api.pb.go
- go api.pb.go
How it works - Again gRPC
gRPC Go Server interface *pb=imported service interface code
Context in golang For deadlines, cancelation, and requested-scoped values -
- cancelation goroutine? - go - Dave Cheny Never start a goroutine without knowing how it will stop
gRPC Go Server - 1 NewServer
gRPC Go Server - 2 RunServer
gRPC Python Client
Try it out! Compile and Run • Server • Client
Diagram Unary RPC Diagram Client Server Request Response
Diagram Stream RPC Diagram Client Server Message Message Message Message
Message Message Example: Chatting
Diagram RPC with goroutine & channel Diagram - 1 Client
Server 1 Request Response Server 2 Request Response
gRPC tips .proto - - git submodule .proto message -
Load balancing - low-latency gRPC client-side LB
gRPC Pros 1.
gRPC Pros 2. .. • HTTP/2 default, binary data, header
compression, cancellation propagation • Google App Engine n1-highcpu-16 CPU 11
gRPC Pros Others • • - , Tracing, Load Balancing,
Health checking
gRPC Cons • - HTTP . (curl, postman..) ..?
gRPC compare with REST • , , REST . •
.. !
Go s http request multiplexer Content-type base routing application/grpc ->
direct grpc else -> grpc-gateway https://github.com/grpc- ecosystem/grpc-gateway
Go s http request multiplexer Alternative way
why gRPC is good at Microservice? What is Microservice •
• / . • ? - - - -
None
why gRPC is good at Microservice? Microservice gRPC • •
• gRPC network latency • typing/versioning •
Summary go grpc • Microservice gRPC • Polyglot • REST
Resources References & Resources • reference tutorial Github . •
https://github.com/EJSohn/microservice-with-go-and-grpc
! Q&A -