Upgrade to Pro — share decks privately, control downloads, hide ads and more …

gRPC with Go

ktr
July 22, 2017

gRPC with Go

ktr

July 22, 2017
Tweet

More Decks by ktr

Other Decks in Programming

Transcript

  1. Profile $ whoami ‣ Taro Aoki / @ktr_0731 ‣ s123@u-aizu

    ‣ αʔόαΠυΤϯδχΞ ‣ Go ͕޷͖ (9 ϲ݄͘Β͍) ‣ Web ͕޷͖
  2. gRPC A RPC library and framework ‣ IDL(Interface Definition Language)

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

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

    Ͱ Service Λఆٛ ‣ σϑΥϧτ͸ Protocol Buffers ‣ αʔό / ΫϥΠΞϯτͷελϒΛࣗಈͰ࡞ͬͯ͘ΕΔ ‣ Interceptors ͕ศར ΋ͷָ͘͢͝!!
  5. gRPC What does "g"RPC stands for? ‣ 1.0: gRPC ‣

    1.1: good ‣ 1.2: green ‣ 1.3: gentle ‣ 1.4: gregarious
  6. gRPC gRPC with Go ‣ gRPC ͱ Go ͸૬ੑ͕ྑ͍ ‣

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

    Interceptor ͕࢖͑Δ ‣ Go ޲͚ͷ gRPC Ecosystem middleware ͕ଟ͍ ‣ ͲͪΒ΋੩తܕ෇͚ ‣ Go Ͱαʔό͕ॻ͚Δتͼ
  8. gRPC Demerits of gRPC ‣ REST ʹൺ΂ͯखಈͷςετ͕໘౗ ‣ ͪΐͬͱͨ࣌͠ʹ curl

    ͰςετͰ͖ͳ͍ ‣ grpc-ecosystem/polyglot ‣ ൚༻త͗ͯ͢࢖͍ͮΒ͍ ‣ Java ͳͷͰ JVM ͷىಈʹ͕͔͔࣌ؒΔ
  9. Evans Overview of Evans ‣ Go ੡ͷ Universal gRPC Client

    ‣ Interactive (REPL) Ϟʔυ ‣ ର࿩తʹ message Λೖྗ ‣ ಈతͳิ׬ػೳ ‣ Non-interactive (CLI) Ϟʔυ ‣ UNIX ఩ֶʹଇΔ
  10. Evans Mechanism ‣ proto ϑΝΠϧΛಡΈࠐΈ ‣ Services / Methods /

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

    Messages Λऔಘ ‣ Message ͷϑΟʔϧυΛऔಘ ‣ ֤ϑΟʔϧυΛೖྗͤ͞Δ ‣ DynamicMessage Λར༻ͯ͠ Message Λ૊ΈཱͯΔ ‣ Remote procedure call