Slide 1

Slide 1 text

GRPC with Go @ktr_0731

Slide 2

Slide 2 text

Profile $ whoami ‣ Taro Aoki / @ktr_0731 ‣ s123@u-aizu ‣ αʔόαΠυΤϯδχΞ ‣ Go ͕޷͖ (9 ϲ݄͘Β͍) ‣ Web ͕޷͖

Slide 3

Slide 3 text

No content

Slide 4

Slide 4 text

No content

Slide 5

Slide 5 text

No content

Slide 6

Slide 6 text

What is gRPC?

Slide 7

Slide 7 text

gRPC A RPC library and framework ‣ IDL(Interface Definition Language) Ͱ Service Λఆٛ ‣ σϑΥϧτ͸ Protocol Buffers ‣ αʔό / ΫϥΠΞϯτͷελϒΛࣗಈͰ࡞ͬͯ͘ΕΔ ‣ Interceptors ͕ศར ‣ middleware ͷΑ͏ͳ΋ͷ

Slide 8

Slide 8 text

gRPC A RPC library and framework ‣ package ‣ messages ‣ services ‣ RPCs

Slide 9

Slide 9 text

No content

Slide 10

Slide 10 text

No content

Slide 11

Slide 11 text

gRPC A RPC library and framework ‣ IDL(Interface Definition Language) Ͱ Service Λఆٛ ‣ σϑΥϧτ͸ Protocol Buffers ‣ αʔό / ΫϥΠΞϯτͷελϒΛࣗಈͰ࡞ͬͯ͘ΕΔ ‣ Interceptors ͕ศར ‣ middleware ͷΑ͏ͳ΋ͷ

Slide 12

Slide 12 text

gRPC A RPC library and framework ‣ IDL(Interface Definition Language) Ͱ Service Λఆٛ ‣ σϑΥϧτ͸ Protocol Buffers ‣ αʔό / ΫϥΠΞϯτͷελϒΛࣗಈͰ࡞ͬͯ͘ΕΔ ‣ Interceptors ͕ศར ΋ͷָ͘͢͝!!

Slide 13

Slide 13 text

gRPC What does "g"RPC stands for? ‣ 1.0: gRPC ‣ 1.1: good ‣ 1.2: green ‣ 1.3: gentle ‣ 1.4: gregarious

Slide 14

Slide 14 text

gRPC gRPC with Go ‣ gRPC ͱ Go ͸૬ੑ͕ྑ͍ ‣ Interceptor ͕࢖͑Δ ‣ Go ޲͚ͷ gRPC Ecosystem middleware ͕ଟ͍ ‣ ͲͪΒ΋੩తܕ෇͚

Slide 15

Slide 15 text

gRPC gRPC with Go ‣ gRPC ͱ Go ͸૬ੑ͕ྑ͍ ‣ Interceptor ͕࢖͑Δ ‣ Go ޲͚ͷ gRPC Ecosystem middleware ͕ଟ͍ ‣ ͲͪΒ΋੩తܕ෇͚ ‣ Go Ͱαʔό͕ॻ͚Δتͼ

Slide 16

Slide 16 text

gRPC

Slide 17

Slide 17 text

gRPC Demerits of gRPC ‣ REST ʹൺ΂ͯखಈͷςετ͕໘౗ ‣ ͪΐͬͱͨ࣌͠ʹ curl ͰςετͰ͖ͳ͍

Slide 18

Slide 18 text

gRPC Demerits of gRPC ‣ REST ʹൺ΂ͯखಈͷςετ͕໘౗ ‣ ͪΐͬͱͨ࣌͠ʹ curl ͰςετͰ͖ͳ͍ ‣ grpc-ecosystem/polyglot ‣ ൚༻త͗ͯ͢࢖͍ͮΒ͍ ‣ Java ͳͷͰ JVM ͷىಈʹ͕͔͔࣌ؒΔ

Slide 19

Slide 19 text

Let’s make it myself

Slide 20

Slide 20 text

lycoris0731/evans

Slide 21

Slide 21 text

lycoris0731/evans ʊਓਓਓਓਓਓʊ ʼɹ։ൃ్தɹʻ ʉ:?:?:?:?:ʉ

Slide 22

Slide 22 text

Evans Overview of Evans ‣ Go ੡ͷ Universal gRPC Client ‣ Interactive (REPL) Ϟʔυ ‣ ର࿩తʹ message Λೖྗ ‣ ಈతͳิ׬ػೳ ‣ Non-interactive (CLI) Ϟʔυ ‣ UNIX ఩ֶʹଇΔ

Slide 23

Slide 23 text

Evans Mechanism ‣ proto ϑΝΠϧΛಡΈࠐΈ ‣ Services / Methods / Messages Λऔಘ ‣ Message ͷϑΟʔϧυΛऔಘ ‣ ֤ϑΟʔϧυΛೖྗͤ͞Δ ‣ DynamicMessage Λར༻ͯ͠ Message Λ૊ΈཱͯΔ ‣ Remote procedure call

Slide 24

Slide 24 text

Evans Mechanism ‣ proto ϑΝΠϧΛಡΈࠐΈ ‣ Services / Methods / Messages Λऔಘ ‣ Message ͷϑΟʔϧυΛऔಘ ‣ ֤ϑΟʔϧυΛೖྗͤ͞Δ ‣ DynamicMessage Λར༻ͯ͠ Message Λ૊ΈཱͯΔ ‣ Remote procedure call

Slide 25

Slide 25 text

Evans Mechanism ‣ go-protobuf ʹ͸ DynamicMessage ͕ͳ͍ ‣ Go Ͱ͍͏ reflect ‣ jhump/protoreflect Λར༻

Slide 26

Slide 26 text

demo

Slide 27

Slide 27 text

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 ͱ͍͏ߟ͑ํ —ͦͷઃܭࢥ૝ͱ఩ֶ