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
610
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
410
Cloud Deep Learning for everyone
ejsohn
0
150
Spot Utilization for GPU Instance Cost Efficiency
ejsohn
0
110
40만명이 쓰는 Django channels 채팅서버, 우리는 어떻게 만들었나?
ejsohn
1
2.5k
Implementing Reactive Programming with ReSwift
ejsohn
0
210
Other Decks in Programming
See All in Programming
CSC305 Lecture 04
javiergs
PRO
0
260
猫と暮らすネットワークカメラ生活🐈 ~Vision frameworkでペットを愛でよう~ / iOSDC Japan 2025
yutailang0119
0
220
overlayPreferenceValue で実現する ピュア SwiftUI な AdMob ネイティブ広告
uhucream
0
170
複雑化したリポジトリをなんとかした話 pipenvからuvによるモノレポ構成への移行
satoshi256kbyte
1
830
2分台で1500examples完走!爆速CIを支える環境構築術 - Kaigi on Rails 2025
falcon8823
3
3.4k
SpecKitでどこまでできる? コストはどれくらい?
leveragestech
0
600
ネイティブ製ガントチャートUIを作って学ぶUICollectionViewLayoutの威力
jrsaruo
0
140
なぜあの開発者はDevRelに伴走し続けるのか / Why Does That Developer Keep Running Alongside DevRel?
nrslib
3
380
Playwrightはどのようにクロスブラウザをサポートしているのか
yotahada3
7
2.3k
10年もののAPIサーバーにおけるCI/CDの改善の奮闘
mbook
0
790
いま中途半端なSwift 6対応をするより、Default ActorやApproachable Concurrencyを有効にしてからでいいんじゃない?
yimajo
2
350
Advance Your Career with Open Source
ivargrimstad
0
380
Featured
See All Featured
The Cost Of JavaScript in 2023
addyosmani
53
9k
Optimising Largest Contentful Paint
csswizardry
37
3.4k
The Invisible Side of Design
smashingmag
301
51k
Reflections from 52 weeks, 52 projects
jeffersonlam
352
21k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
29
2.6k
Rebuilding a faster, lazier Slack
samanthasiow
84
9.2k
VelocityConf: Rendering Performance Case Studies
addyosmani
332
24k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
32
2.2k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
32
1.6k
Visualization
eitanlees
148
16k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
367
27k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
52
5.6k
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 -