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

gRPC with Node.js

Lucas Santos
September 16, 2020

gRPC with Node.js

Lucas Santos

September 16, 2020
Tweet

More Decks by Lucas Santos

Other Decks in Programming

Transcript

  1. gRPC - Developed by Google in 2015 - Uses HTTP/2

    for transport - RPC stands for "remote procedure call" - Directly calls a method on the server as if it were a local object - Uses protobuf as IDL - Interoperable among languages
  2. JRMI - Java Remote Method Invocation Client Remote object Interface

    Stub Remote Object Implementation Remote object Interface Skeleton Client Server Implemented by the developer Implemented by JRMI
  3. protobuf - OSS, Developed by Google - Mechanism for serializing

    structured data - Interface Definition Language - Requires compiling
  4. Problems - Docs are not very common - The initial

    development is more complex - Usage with TypeScript requires some work - It is a bit complicated to understand the idea and concepts
  5. Advantages of gRPC - Way smaller due to binary transfer

    - HTTP/2 by default - Simple client calls - Lighter and supports a lot of calls - Supports streaming both in client and server - Protobuf standardizes the message exchange
  6. refs_ - https://en.wikipedia.org/wiki/Remote_procedure_call - https://grpc.io/docs/what-is-grpc/introduction/ - https://developers.google.com/protocol-buffers - https://developers.google.com/protocol-buffers/docs/reference/javascript-generated -

    https://medium.com/xp-inc/introdu%C3%A7%C3%A3o-ao-grpc-com-node-js-98f6a4ede11 - https://grpc.io/docs/what-is-grpc/core-concepts/ - https://blog.logrocket.com/creating-a-crud-api-with-node-express-and-grpc/ - https://github.com/khaosdoctor/grpc-nodejs-demo-app