Raw nots from Ray Tsang's talk about gRPC.

Finally was able to get to a session before it started. HTTP/2 Demo.

Gave definition of saturnism: lead poisoning.

Trend: revisit: breaking down monolith into Microservices. Or creating microservices in greenfield. A lot of overhead for this approach: distributed systems problems. Need additional tooling.

Referenced CORBA tutorial here.

RPC has a bad rep. But he spoke highly of RMI. Everything just works. But you have to be in Java on both sides. To fix this, we came up with SOAP, which lead to REST. Why RPC: efficient and strongly type. REST: everything is CRUDy. What about how to represent, for example, a bank account transfer operation? On REST, you also have to write client libraries. RPC can be great if it is simple and interoperable.

At Google, they use Stubby. It does O(1010). They wanted to open source Stubby. Square used to have their own RPC thing. They combined and made gRPC. Owned by the cloud native foundation. The G in GPRC means GRPC.

Transport is in HTTP/2: binary protocol. Gave a little talk over HTTP/2 features: binary, streams, HPACK, PUSH. Protobuffer 3. Marshalling and unmarshalling data.

Showed a graph showing throughput/cpu core: binary is faster than text. It is also better for battery life.

gRPC supports: C++, Objective C, PHP, Java.

Finished the slideware at 14 minutes in.

Protofile is the IDL file. There you define the message payloads, messages, etc. Must define request and response payloads.



    syntax = "proto3";

    package com.example.grpc;

    option java_multiple_files = true;

    enum Sentiment {
    HAPPY = 0;
    SAD = 1;
    }

    message HelloRequest {
    string firstname = 1;
    string lastmame = 2;
    int64 age = 3;
    Sentiment sentiment = 4;
    repeated string hobbies = 5;
    map<string, string> bagOfTricks = 6;
    
    }

    message HelloResponse {
    string greeting = 1;
    }

    service GreetingService {
    rpc greeting([stream] HelloRequest) returns ([stream] HelloResponse);
    }
    
  

To run it, include mvn dependencies. There are also stub generation plugins.


    public class GreetingImpl extends GreetingServiceGrpc.GreetingServiceImplBase {
    public void greeting(HelloRequest, StreamObserver response);
    
    }

Automatically supports onNext, onCompleted, onError. All builder based.

The client uses channels. Supports client side interceptors. Supports load balancing. Round robin. Supports deadlines for calls. This is kind of a built-in circuit breakers.