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
gRPC with Go
Search
ktr
July 22, 2017
Programming
0
800
gRPC with Go
ktr
July 22, 2017
Tweet
Share
More Decks by ktr
See All by ktr
Monorepo における Go テストの差分実行 / Running Differential Go Tests in a Monorepo
ktr_0731
0
100
Designing libraries in Go way
ktr_0731
6
1.5k
Go Modules and Proxy Walkthrough
ktr_0731
8
27k
ソフトウェアの複雑さに立ち向かう技術 / Tackling software complexity
ktr_0731
0
180
Fuzzy finder as a Go library
ktr_0731
3
5.7k
つよくてニューゲーム / NewGame++
ktr_0731
0
950
やはり俺の Go アプリケーション設計はまちがっている。 / My Go Application Design Is Wrong, As I Expected
ktr_0731
13
3.5k
GopherCon2018
ktr_0731
2
1.8k
Evans: more expressive gRPC client
ktr_0731
2
460
Other Decks in Programming
See All in Programming
2025.01.17_Sansan × DMM.swift
riofujimon
2
560
Оптимизируем производительность блока Казначейство
lamodatech
0
950
PSR-15 はあなたのための ものではない? - phpcon2024
myamagishi
0
410
見えないメモリを観測する: PHP 8.4 `pg_result_memory_size()` とSQL結果のメモリ管理
kentaroutakeda
0
940
20年もののレガシープロダクトに 0からPHPStanを入れるまで / phpcon2024
hirobe1999
0
1k
KMP와 kotlinx.rpc로 서버와 클라이언트 동기화
kwakeuijin
0
300
EC2からECSへ 念願のコンテナ移行と巨大レガシーPHPアプリケーションの再構築
sumiyae
3
590
PHPで作るWebSocketサーバー ~リアクティブなアプリケーションを知るために~ / WebSocket Server in PHP - To know reactive applications
seike460
PRO
2
770
最近のVS Codeで気になるニュース 2025/01
74th
1
100
Androidアプリのモジュール分割における:x:commonを考える
okuzawats
1
280
AHC041解説
terryu16
0
400
shadcn/uiを使ってReactでの開発を加速させよう!
lef237
0
300
Featured
See All Featured
Agile that works and the tools we love
rasmusluckow
328
21k
Building Better People: How to give real-time feedback that sticks.
wjessup
366
19k
Thoughts on Productivity
jonyablonski
68
4.4k
Large-scale JavaScript Application Architecture
addyosmani
510
110k
Raft: Consensus for Rubyists
vanstee
137
6.7k
Producing Creativity
orderedlist
PRO
343
39k
Git: the NoSQL Database
bkeepers
PRO
427
64k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
7
570
KATA
mclloyd
29
14k
Making the Leap to Tech Lead
cromwellryan
133
9k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
30
2.1k
Speed Design
sergeychernyshev
25
740
Transcript
GRPC with Go @ktr_0731
Profile $ whoami ‣ Taro Aoki / @ktr_0731 ‣ s123@u-aizu
‣ αʔόαΠυΤϯδχΞ ‣ Go ͕͖ (9 ϲ݄͘Β͍) ‣ Web ͕͖
None
None
None
What is gRPC?
gRPC A RPC library and framework ‣ IDL(Interface Definition Language)
Ͱ Service Λఆٛ ‣ σϑΥϧτ Protocol Buffers ‣ αʔό / ΫϥΠΞϯτͷελϒΛࣗಈͰ࡞ͬͯ͘ΕΔ ‣ Interceptors ͕ศར ‣ middleware ͷΑ͏ͳͷ
gRPC A RPC library and framework ‣ package ‣ messages
‣ services ‣ RPCs
None
None
gRPC A RPC library and framework ‣ IDL(Interface Definition Language)
Ͱ Service Λఆٛ ‣ σϑΥϧτ Protocol Buffers ‣ αʔό / ΫϥΠΞϯτͷελϒΛࣗಈͰ࡞ͬͯ͘ΕΔ ‣ Interceptors ͕ศར ‣ middleware ͷΑ͏ͳͷ
gRPC A RPC library and framework ‣ IDL(Interface Definition Language)
Ͱ Service Λఆٛ ‣ σϑΥϧτ Protocol Buffers ‣ αʔό / ΫϥΠΞϯτͷελϒΛࣗಈͰ࡞ͬͯ͘ΕΔ ‣ Interceptors ͕ศར ͷָ͘͢͝!!
gRPC What does "g"RPC stands for? ‣ 1.0: gRPC ‣
1.1: good ‣ 1.2: green ‣ 1.3: gentle ‣ 1.4: gregarious
gRPC gRPC with Go ‣ gRPC ͱ Go ૬ੑ͕ྑ͍ ‣
Interceptor ͕͑Δ ‣ Go ͚ͷ gRPC Ecosystem middleware ͕ଟ͍ ‣ ͲͪΒ੩తܕ͚
gRPC gRPC with Go ‣ gRPC ͱ Go ૬ੑ͕ྑ͍ ‣
Interceptor ͕͑Δ ‣ Go ͚ͷ gRPC Ecosystem middleware ͕ଟ͍ ‣ ͲͪΒ੩తܕ͚ ‣ Go Ͱαʔό͕ॻ͚Δتͼ
gRPC
gRPC Demerits of gRPC ‣ REST ʹൺͯखಈͷςετ͕໘ ‣ ͪΐͬͱͨ࣌͠ʹ curl
ͰςετͰ͖ͳ͍
gRPC Demerits of gRPC ‣ REST ʹൺͯखಈͷςετ͕໘ ‣ ͪΐͬͱͨ࣌͠ʹ curl
ͰςετͰ͖ͳ͍ ‣ grpc-ecosystem/polyglot ‣ ൚༻త͍͗ͯͮ͢Β͍ ‣ Java ͳͷͰ JVM ͷىಈʹ͕͔͔࣌ؒΔ
Let’s make it myself
lycoris0731/evans
lycoris0731/evans ʊਓਓਓਓਓਓʊ ʼɹ։ൃ్தɹʻ ʉ:?:?:?:?:ʉ
Evans Overview of Evans ‣ Go ͷ Universal gRPC Client
‣ Interactive (REPL) Ϟʔυ ‣ ରతʹ message Λೖྗ ‣ ಈతͳิػೳ ‣ Non-interactive (CLI) Ϟʔυ ‣ UNIX ֶʹଇΔ
Evans Mechanism ‣ proto ϑΝΠϧΛಡΈࠐΈ ‣ Services / Methods /
Messages Λऔಘ ‣ Message ͷϑΟʔϧυΛऔಘ ‣ ֤ϑΟʔϧυΛೖྗͤ͞Δ ‣ DynamicMessage Λར༻ͯ͠ Message ΛΈཱͯΔ ‣ Remote procedure call
Evans Mechanism ‣ proto ϑΝΠϧΛಡΈࠐΈ ‣ Services / Methods /
Messages Λऔಘ ‣ Message ͷϑΟʔϧυΛऔಘ ‣ ֤ϑΟʔϧυΛೖྗͤ͞Δ ‣ DynamicMessage Λར༻ͯ͠ Message ΛΈཱͯΔ ‣ Remote procedure call
Evans Mechanism ‣ go-protobuf ʹ DynamicMessage ͕ͳ͍ ‣ Go Ͱ͍͏
reflect ‣ jhump/protoreflect Λར༻
demo
CLI References ‣ GoݴޠͰςετ͍͢͠ίϚϯυϥΠϯπʔϧΛͭ͘Δ (http://deeeet.com/writing/2014/12/18/golang-cli-test/) ‣ GoݴޠʹΑΔCLIπʔϧ։ൃͱUNIXֶʹ͍ͭͯ (http://blog.yuuk.io/entry/go-cli-unix) ‣ UNIX
ͱ͍͏ߟ͑ํ —ͦͷઃܭࢥͱֶ