Teach your (micro)services speak Protocol Buffers with gRPC. Mihai - - PowerPoint PPT Presentation

teach your micro services speak protocol buffers with grpc
SMART_READER_LITE
LIVE PREVIEW

Teach your (micro)services speak Protocol Buffers with gRPC. Mihai - - PowerPoint PPT Presentation

Teach your (micro)services speak Protocol Buffers with gRPC. Mihai Iachimovschi @mishunika mihai.iachimovschi@gmail.com Whats inside? Whats inside? Message serialization and deserialization Whats inside? Message serialization


slide-1
SLIDE 1

Teach your (micro)services speak Protocol Buffers with gRPC.

Mihai Iachimovschi @mishunika mihai.iachimovschi@gmail.com

slide-2
SLIDE 2

What’s inside?

slide-3
SLIDE 3

What’s inside?

–Message serialization and deserialization

slide-4
SLIDE 4

What’s inside?

–Message serialization and deserialization –Message transport

slide-5
SLIDE 5

What’s inside?

–Message serialization and deserialization –Message transport –Services diversity

slide-6
SLIDE 6

How it works in real life

A B C D

slide-7
SLIDE 7

How it works in real life

A B C D

slide-8
SLIDE 8

In a nutshell

Client Service

slide-9
SLIDE 9

In a nutshell

–Over HTTP –Serialized to JSON

Client Service

slide-10
SLIDE 10

In a nutshell

–Over HTTP –Serialized to JSON

Client Service

–Proprietary protocol –Remote objects

slide-11
SLIDE 11

JSON advantages

slide-12
SLIDE 12

JSON advantages

–Human readable

slide-13
SLIDE 13

JSON advantages

–Human readable –Schema-less

slide-14
SLIDE 14

JSON advantages

–Human readable –Schema-less –Language agnostic

slide-15
SLIDE 15

JSON disadvantages

slide-16
SLIDE 16

JSON disadvantages

–Human readable

slide-17
SLIDE 17

JSON disadvantages

–Human readable

Isn’t it a benefit?

slide-18
SLIDE 18

JSON disadvantages

–Human readable –Schema-less

Isn’t it a benefit?

slide-19
SLIDE 19

JSON disadvantages

–Human readable –Schema-less

Isn’t it a benefit? Isn’t it a benefit as well?

slide-20
SLIDE 20

JSON disadvantages

–Human readable –Schema-less –Type-less

Isn’t it a benefit? Isn’t it a benefit as well?

slide-21
SLIDE 21

Protocol Buffers?

“Protocol buffers are Google's language-neutral, platform-neutral, extensible mechanism for serializing structured data – think XML, but smaller, faster, and simpler.” — https://developers.google.com/protocol-buffers/

slide-22
SLIDE 22

Protocol Buffers?

“Protocol buffers are Google's language-neutral, platform-neutral, extensible mechanism for serializing structured data – think XML, but smaller, faster, and simpler.” — https://developers.google.com/protocol-buffers/

slide-23
SLIDE 23

Protocol Buffers?

“Protocol buffers are Google's language-neutral, platform-neutral, extensible mechanism for serializing structured data – think XML, but smaller, faster, and simpler.” — https://developers.google.com/protocol-buffers/ JSON

slide-24
SLIDE 24

Protocol Buffers example

message Person { string name = 1; int32 id = 2; repeated string aliases = 3; }

slide-25
SLIDE 25

Protocol Buffers example

message Person { string name = 1; int32 id = 2; repeated string aliases = 3; }

slide-26
SLIDE 26

Protocol Buffers example

message Person { string name = 1; int32 id = 2; repeated string aliases = 3; }

slide-27
SLIDE 27

Protocol Buffers example

message Person { string name = 1; int32 id = 2; repeated string aliases = 3; }

slide-28
SLIDE 28

Protocol Buffers example

message Person { string name = 1; int32 id = 2; repeated string aliases = 3; }

slide-29
SLIDE 29

Protocol Buffers example

message Person { string name = 1; int32 id = 2; repeated string aliases = 3; }

slide-30
SLIDE 30

Protocol Buffers example

message Person { reserved 1, 2, 5; reserved "name"; int32 id = 3; repeated string aliases = 4; }

slide-31
SLIDE 31

Why protocol buffers

Binary format

slide-32
SLIDE 32

Why protocol buffers

Enforcing the schema

slide-33
SLIDE 33

Why protocol buffers

Language neutral

slide-34
SLIDE 34

Out-of the box backward compatibility

Why protocol buffers

slide-35
SLIDE 35

Out-of the box backward compatibility

Why protocol buffers

slide-36
SLIDE 36

Out-of the box backward compatibility

if version == 3: ... elif version > 4: if (version == 5): ... ...

Why protocol buffers

slide-37
SLIDE 37

Why protocol buffers

Generally faster

slide-38
SLIDE 38

How to…

message Person { string name = 1; int32 id = 2; repeated string aliases = 3; }

slide-39
SLIDE 39

How to…

message Person { string name = 1; int32 id = 2; repeated string aliases = 3; } Proto message definition

slide-40
SLIDE 40

How to…

message Person { string name = 1; int32 id = 2; repeated string aliases = 3; } Person john = Person.newBuilder() .setId(1234) .setName("John Doe") .addAliases("ionel") .build(); Proto message definition

slide-41
SLIDE 41

How to…

message Person { string name = 1; int32 id = 2; repeated string aliases = 3; } Person john = Person.newBuilder() .setId(1234) .setName("John Doe") .addAliases("ionel") .build(); Proto message definition Object creation

slide-42
SLIDE 42

How to…

message Person { string name = 1; int32 id = 2; repeated string aliases = 3; } john = Person() john.id = 1234 john.name = 'John Doe' john.aliases.add(‘ionel’) Proto message definition Object creation

slide-43
SLIDE 43

How to…

message Person { string name = 1; int32 id = 2; repeated string aliases = 3; } john = Person(id=1234, name='John Doe', aliases=['ionel']) Proto message definition Object creation

slide-44
SLIDE 44

Communication (REST-ish)

  • 1. URI: https://api.example.com/person/42
  • 2. Make an HTTP GET Request
  • 3. Receive a plaintext JSON
  • 4. Parse it
  • 5. …
slide-45
SLIDE 45

Request

GET /person/42 HTTP/1.1 Accept: */* Accept-Encoding: gzip, deflate Connection: keep-alive Host: api.example.com ...

slide-46
SLIDE 46

Response headers

HTTP/1.1 200 OK Access-Control-Allow-Credentials: true Cache-Control: public, max-age=14400 Content-Encoding: gzip Content-Type: application/json; charset=utf-8 ...

slide-47
SLIDE 47

Response body

{ "name": "John Doe", "id": 42, "aliases": [ "ionel", "honzík" ] }

slide-48
SLIDE 48

HTTP2

https://www.youtube.com/watch?v=DtTKF5OcpsU

slide-49
SLIDE 49

Distributed objects

https://en.wikipedia.org/wiki/Distributed_object

slide-50
SLIDE 50

Distributed objects

“First Law of Distributed Object Design:
 don't distribute your objects”. — Martin Fowler

https://martinfowler.com/articles/distributed-objects-microservices.html

slide-51
SLIDE 51

The 8 Fallacies of distributed computing

1. The network is reliable. 2. Latency is zero. 3. Bandwidth is infinite. 4. The network is secure. 5. Topology doesn't change. 6. There is one administrator. 7. Transport cost is zero. 8. The network is homogeneous.

http://www.rgoarchitects.com/Files/fallacies.pdf

slide-52
SLIDE 52

Keep in mind…

“Anything that can go wrong will go wrong.” —Murphy’s Law

slide-53
SLIDE 53

So, what’s next?

slide-54
SLIDE 54

Services not Objects, Messages not References

http://www.grpc.io/blog/principles

slide-55
SLIDE 55

Coverage & Simplicity

http://www.grpc.io/blog/principles

slide-56
SLIDE 56

How does it work

slide-57
SLIDE 57

Service definition

service RoutePlanner { rpc GetRoutes (GetRoutesRequest) returns (GetRoutesResponse) {} }

slide-58
SLIDE 58

Service definition

service RoutePlanner { rpc GetRoutes (GetRoutesRequest) returns (GetRoutesResponse) {} }

slide-59
SLIDE 59

Service definition

service RoutePlanner { rpc GetRoutes (GetRoutesRequest) returns (GetRoutesResponse) {} }

slide-60
SLIDE 60

Service definition

service RoutePlanner { rpc GetRoutes (GetRoutesRequest) returns (GetRoutesResponse) {} }

slide-61
SLIDE 61

Service definition

service RoutePlanner { rpc GetRoutes (GetRoutesRequest) returns (GetRoutesResponse) {} }

slide-62
SLIDE 62

Service definition

service RoutePlanner { rpc GetRoutes (GetRoutesRequest) returns (GetRoutesResponse) {} }

slide-63
SLIDE 63

Service definition

message GetRoutesRequest { Location origin = 1; Location destination = 2; } message GetRoutesResponse { repeated Route routes = 1; }

slide-64
SLIDE 64

Generate server code

$ python -m grpc_tools.protoc \


  • -proto_path=../protos \ 

  • -python_out=. \

  • -grpc_python_out=. \


../protos/route_planner.proto

slide-65
SLIDE 65

Generate server code

$ python -m grpc_tools.protoc \


  • -proto_path=../protos \ 

  • -python_out=. \

  • -grpc_python_out=. \


../protos/route_planner.proto

slide-66
SLIDE 66

Generate server code

$ python -m grpc_tools.protoc \


  • -proto_path=../protos \ 

  • -python_out=. \

  • -grpc_python_out=. \


../protos/route_planner.proto

slide-67
SLIDE 67

Generate server code

$ python -m grpc_tools.protoc \


  • -proto_path=../protos \ 

  • -python_out=. \

  • -grpc_python_out=. \


../protos/route_planner.proto

slide-68
SLIDE 68

Generate server code

$ python -m grpc_tools.protoc \


  • -proto_path=../protos \ 

  • -python_out=. \

  • -grpc_python_out=. \


../protos/route_planner.proto

slide-69
SLIDE 69

Generate server code

$ python -m grpc_tools.protoc \


  • -proto_path=../protos \ 

  • -python_out=. \

  • -grpc_python_out=. \


../protos/route_planner.proto

slide-70
SLIDE 70

Generate server code

$ python -m grpc_tools.protoc \


  • -proto_path=../protos \ 

  • -python_out=. \

  • -grpc_python_out=. \


../protos/route_planner.proto

slide-71
SLIDE 71

Generated code

$ tree . ├── route_planner_pb2.py └── route_planner_pb2_grpc.py 0 directories, 2 files

slide-72
SLIDE 72

Implementing the service

slide-73
SLIDE 73

Implementing the service

slide-74
SLIDE 74

Service code

class Servicer(route_planner_pb2_grpc.RoutePlannerServicer): """Service implementation.""" def GetRoutes(self, request, context): return process_magically_the_request(request)

slide-75
SLIDE 75

Service code

server = grpc.server( futures.ThreadPoolExecutor(max_workers=10)) route_planner_pb2_grpc.add_RoutePlannerServicer_to_server( Servicer(), server) server.add_insecure_port('[::]:12345') server.start()

slide-76
SLIDE 76

Service code

server = grpc.server( futures.ThreadPoolExecutor(max_workers=10)) route_planner_pb2_grpc.add_RoutePlannerServicer_to_server( Servicer(), server) server.add_insecure_port('[::]:12345') server.start()

slide-77
SLIDE 77

Service code

server = grpc.server( futures.ThreadPoolExecutor(max_workers=10)) route_planner_pb2_grpc.add_RoutePlannerServicer_to_server( Servicer(), server) server.add_insecure_port('[::]:12345') server.start()

slide-78
SLIDE 78

Service code

server = grpc.server( futures.ThreadPoolExecutor(max_workers=10)) route_planner_pb2_grpc.add_RoutePlannerServicer_to_server( Servicer(), server) server.add_insecure_port('[::]:12345') server.start()

slide-79
SLIDE 79

Service code

server = grpc.server( futures.ThreadPoolExecutor(max_workers=10)) route_planner_pb2_grpc.add_RoutePlannerServicer_to_server( Servicer(), server) server.add_insecure_port('[::]:12345') server.start()

slide-80
SLIDE 80

Implementing the client

slide-81
SLIDE 81

Implementing the client

slide-82
SLIDE 82

Client code

channel = grpc.insecure_channel(‘localhost:12345') stub = route_planner_pb2_grpc.RoutePlannerStub(channel) request = route_planner_pb2.GetRoutesRequest(

  • rigin=CURRENT_LOCATION,

destination=DESTINATION_COORDS) response = stub.GetRoutes(request)

slide-83
SLIDE 83

Client code

channel = grpc.insecure_channel(‘localhost:12345') stub = route_planner_pb2_grpc.RoutePlannerStub(channel) request = route_planner_pb2.GetRoutesRequest(

  • rigin=CURRENT_LOCATION,

destination=DESTINATION_COORDS) response = stub.GetRoutes(request)

slide-84
SLIDE 84

Client code

channel = grpc.insecure_channel(‘localhost:12345') stub = route_planner_pb2_grpc.RoutePlannerStub(channel) request = route_planner_pb2.GetRoutesRequest(

  • rigin=CURRENT_LOCATION,

destination=DESTINATION_COORDS) response = stub.GetRoutes(request)

slide-85
SLIDE 85

Client code

channel = grpc.insecure_channel(‘localhost:12345') stub = route_planner_pb2_grpc.RoutePlannerStub(channel) request = route_planner_pb2.GetRoutesRequest(

  • rigin=CURRENT_LOCATION,

destination=DESTINATION_COORDS) response = stub.GetRoutes(request)

slide-86
SLIDE 86

Client code

channel = grpc.insecure_channel(‘localhost:12345') stub = route_planner_pb2_grpc.RoutePlannerStub(channel) request = route_planner_pb2.GetRoutesRequest(

  • rigin=CURRENT_LOCATION,

destination=DESTINATION_COORDS) response = stub.GetRoutes(request)

slide-87
SLIDE 87

Client code

channel = grpc.insecure_channel(‘localhost:12345') stub = route_planner_pb2_grpc.RoutePlannerStub(channel) request = route_planner_pb2.GetRoutesRequest(

  • rigin=CURRENT_LOCATION,

destination=DESTINATION_COORDS) response = stub.GetRoutes(request)

slide-88
SLIDE 88

Client code (async)

response_future = stub.GetRoutes.future(request) response_future.result()

slide-89
SLIDE 89

grpc_cli

$ grpc_cli call localhost:12345 \
 RoutePlanner.GetRoutes \
 <<- PROTO


  • rigin: <long: 0.0 lat: 0.0> 


destination: <long: 1.1 lat: 1.1>
 PROTO

slide-90
SLIDE 90

grpc_cli

$ grpc_cli call localhost:12345 \
 RoutePlanner.GetRoutes \
 <<- PROTO


  • rigin: <long: 0.0 lat: 0.0> 


destination: <long: 1.1 lat: 1.1>
 PROTO

slide-91
SLIDE 91

grpc_cli

$ grpc_cli call localhost:12345 \
 RoutePlanner.GetRoutes \
 <<- PROTO


  • rigin: <long: 0.0 lat: 0.0> 


destination: <long: 1.1 lat: 1.1>
 PROTO

slide-92
SLIDE 92

grpc_cli

$ grpc_cli call localhost:12345 \
 RoutePlanner.GetRoutes \
 <<- PROTO


  • rigin: <long: 0.0 lat: 0.0> 


destination: <long: 1.1 lat: 1.1>
 PROTO

slide-93
SLIDE 93

grpc_cli

$ grpc_cli call localhost:12345 \
 RoutePlanner.GetRoutes \
 <<- PROTO


  • rigin: <long: 0.0 lat: 0.0> 


destination: <long: 1.1 lat: 1.1>
 PROTO

slide-94
SLIDE 94

grpc_cli

Rpc succeeded with OK status 
 Response:
 routes: <...>
 routes: <...>
 routes: <...>
 routes: <...>

slide-95
SLIDE 95

Service definition

service RoutePlanner { rpc GetRoutes (GetRoutesRequest) returns (GetRoutesResponse) {} }

slide-96
SLIDE 96

Service definition - response streaming

service RoutePlanner { rpc GetRoutes (GetRoutesRequest) returns (stream GetRoutesResponse) {} }

slide-97
SLIDE 97

Service definition

service RoutePlanner { rpc GetRoutes (GetRoutesRequest) returns (GetRoutesResponse) {} }

slide-98
SLIDE 98

Service definition - request streaming

service RoutePlanner { rpc GetRoutes (stream GetRoutesRequest) returns (GetRoutesResponse) {} }

slide-99
SLIDE 99

Request streaming? Response streaming?

slide-100
SLIDE 100

Request streaming? Response streaming?

slide-101
SLIDE 101

Service definition - bidirectional streaming

service RoutePlanner { rpc GetRoutes (stream GetRoutesRequest) returns (stream GetRoutesResponse) {} }

slide-102
SLIDE 102

Keep in mind…

Things will go wrong

slide-103
SLIDE 103

Timeouts

Client Service B A C D E

? ms ? ms ? ms ? ms ? ms ? ms

slide-104
SLIDE 104

Uniform timeout

Client Service A B

slide-105
SLIDE 105

Uniform timeout

Client Service A B

500 ms timeout 500 ms timeout 500 ms timeout

slide-106
SLIDE 106

Uniform timeout

Client Service A

20 ms

B

500 ms timeout 500 ms timeout 500 ms timeout

slide-107
SLIDE 107

Uniform timeout

Client Service A

20 ms 30 ms

B

500 ms timeout 500 ms timeout 500 ms timeout

slide-108
SLIDE 108

Uniform timeout

Client Service A

20 ms 30 ms

B

40 ms 500 ms timeout 500 ms timeout 500 ms timeout

slide-109
SLIDE 109

Uniform timeout

Client Service A

20 ms 30 ms

B

40 ms 420 ms 500 ms timeout 500 ms timeout 500 ms timeout

slide-110
SLIDE 110

Uniform timeout

Client Service A

20 ms 30 ms

B

40 ms 420 ms 500 ms timeout 500 ms timeout 500 ms timeout

X

slide-111
SLIDE 111

Uniform timeout

Client Service A

20 ms 30 ms

B

40 ms 20 ms 420 ms 500 ms timeout 500 ms timeout 500 ms timeout

X X

slide-112
SLIDE 112

Fine-tuned timeout

Client Service A B

slide-113
SLIDE 113

Fine-tuned timeout

Client Service A B

300 ms timeout 280 ms timeout 50 ms timeout

slide-114
SLIDE 114

Fine-tuned timeout

Client Service A

20 ms

B

300 ms timeout 280 ms timeout 50 ms timeout

slide-115
SLIDE 115

Fine-tuned timeout

Client Service A

20 ms 30 ms

B

300 ms timeout 280 ms timeout 50 ms timeout

slide-116
SLIDE 116

Fine-tuned timeout

Client Service A

20 ms 30 ms

B

15 ms 300 ms timeout 280 ms timeout 50 ms timeout

slide-117
SLIDE 117

Fine-tuned timeout

Client Service A

20 ms 30 ms

B

15 ms 40 ms 300 ms timeout 280 ms timeout 50 ms timeout

slide-118
SLIDE 118

Fine-tuned timeout

Client Service A

20 ms 30 ms

B

15 ms 40 ms 300 ms timeout 280 ms timeout 50 ms timeout

X

slide-119
SLIDE 119

Adaptive timeout

Client Service A B

slide-120
SLIDE 120

Adaptive timeout

Client Service A B

200 ms timeout

slide-121
SLIDE 121

Adaptive timeout

Client Service A

20 ms

B

200 ms timeout

slide-122
SLIDE 122

Adaptive timeout

Client Service A

20 ms

B

200 ms timeout 200ms - 20ms = 180 ms

slide-123
SLIDE 123

Adaptive timeout

Client Service A

20 ms 30 ms

B

200 ms timeout 200ms - 20ms = 180 ms

slide-124
SLIDE 124

Adaptive timeout

Client Service A

20 ms 30 ms

B

200 ms timeout 200ms - 20ms = 180 ms 180ms - 30ms = 150ms

slide-125
SLIDE 125

Adaptive timeout

Client Service A

20 ms 30 ms

B

15 ms 200 ms timeout 200ms - 20ms = 180 ms 180ms - 30ms = 150ms

slide-126
SLIDE 126

Adaptive timeout

Client Service A

20 ms 30 ms

B

15 ms 40 ms 200 ms timeout 200ms - 20ms = 180 ms 180ms - 30ms = 150ms

slide-127
SLIDE 127

Adaptive timeout

Client Service A

20 ms 30 ms

B

15 ms 20 ms 40 ms 200 ms timeout 200ms - 20ms = 180 ms 180ms - 30ms = 150ms

slide-128
SLIDE 128

Adaptive timeout

Client Service A

20 ms 30 ms

B

15 ms 40 ms 20 ms 40 ms 200 ms timeout 200ms - 20ms = 180 ms 180ms - 30ms = 150ms

slide-129
SLIDE 129

gRPC: Deadlines

slide-130
SLIDE 130

gRPC: Deadlines

– Timeout is relative

slide-131
SLIDE 131

gRPC: Deadlines

– Timeout is relative – Deadline is absolute

slide-132
SLIDE 132

Deadline propagation

Client Service A B

Start TS: 3600000 Timeout: 200 Deadline: 3600200

slide-133
SLIDE 133

Deadline propagation

Client Service A B

Start TS: 3600000 Timeout: 200 Deadline: 3600200 TS: 3600000

slide-134
SLIDE 134

Deadline propagation

Client Service A

20 ms

B

Start TS: 3600000 Timeout: 200 Deadline: 3600200 TS: 3600000

slide-135
SLIDE 135

Deadline propagation

Client Service A

20 ms

B

Start TS: 3600000 Timeout: 200 Deadline: 3600200 TS: 3600020 TS: 3600000

slide-136
SLIDE 136

Deadline propagation

Client Service A

20 ms 30 ms

B

Start TS: 3600000 Timeout: 200 Deadline: 3600200 TS: 3600020 TS: 3600000

slide-137
SLIDE 137

Deadline propagation

Client Service A

20 ms 30 ms

B

Start TS: 3600000 Timeout: 200 Deadline: 3600200 TS: 3600020 TS: 3600050 TS: 3600000

slide-138
SLIDE 138

Deadline propagation

Client Service A

20 ms 30 ms

B

15 ms Start TS: 3600000 Timeout: 200 Deadline: 3600200 TS: 3600020 TS: 3600050 TS: 3600000

slide-139
SLIDE 139

Deadline propagation

Client Service A

20 ms 30 ms

B

15 ms Start TS: 3600000 Timeout: 200 Deadline: 3600200 TS: 3600020 TS: 3600050 TS: 3600045 TS: 3600000

slide-140
SLIDE 140

Deadline propagation

Client Service A

20 ms 30 ms

B

15 ms 40 ms Start TS: 3600000 Timeout: 200 Deadline: 3600200 TS: 3600020 TS: 3600050 TS: 3600045 TS: 3600000

slide-141
SLIDE 141

Deadline propagation

Client Service A

20 ms 30 ms

B

15 ms 40 ms Start TS: 3600000 Timeout: 200 Deadline: 3600200 TS: 3600020 TS: 3600050 TS: 3600045 TS: 3600085 TS: 3600000

slide-142
SLIDE 142

Deadline propagation

Client Service A

20 ms 30 ms

B

15 ms 20 ms 40 ms Start TS: 3600000 Timeout: 200 Deadline: 3600200 TS: 3600020 TS: 3600050 TS: 3600045 TS: 3600085 TS: 3600000

slide-143
SLIDE 143

Deadline propagation

Client Service A

20 ms 30 ms

B

15 ms 20 ms 40 ms Start TS: 3600000 Timeout: 200 Deadline: 3600200 TS: 3600020 TS: 3600050 TS: 3600045 TS: 3600105 TS: 3600085 TS: 3600000

slide-144
SLIDE 144

Deadline propagation

Client Service A

20 ms 30 ms

B

15 ms 40 ms 20 ms 40 ms Start TS: 3600000 Timeout: 200 Deadline: 3600200 TS: 3600020 TS: 3600050 TS: 3600045 TS: 3600105 TS: 3600085 TS: 3600000

slide-145
SLIDE 145

Deadline propagation

Client Service A

20 ms 30 ms

B

15 ms 40 ms 20 ms 40 ms Start TS: 3600000 Timeout: 200 Deadline: 3600200 TS: 3600020 TS: 3600050 TS: 3600045 TS: 3600105 TS: 3600085 TS: 3600145 TS: 3600000

slide-146
SLIDE 146

Deadline propagation

Client Service A B

Start TS: 3600000 Timeout: 200 Deadline: 3600200

slide-147
SLIDE 147

Deadline propagation

Client Service A B

Start TS: 3600000 Timeout: 200 Deadline: 3600200 TS: 3600000

slide-148
SLIDE 148

Deadline propagation

Client Service A

150ms

B

Start TS: 3600000 Timeout: 200 Deadline: 3600200 TS: 3600000

slide-149
SLIDE 149

Deadline propagation

Client Service A

150ms

B

Start TS: 3600000 Timeout: 200 Deadline: 3600200 TS: 3600150 TS: 3600000

slide-150
SLIDE 150

Deadline propagation

Client Service A

150ms 100 ms

B

Start TS: 3600000 Timeout: 200 Deadline: 3600200 TS: 3600150 TS: 3600000

slide-151
SLIDE 151

Deadline propagation

Client Service A

150ms 100 ms

B

Start TS: 3600000 Timeout: 200 Deadline: 3600200 TS: 3600150 TS: 3600250 TS: 3600000

slide-152
SLIDE 152

Deadline propagation

Client Service A

150ms 100 ms

B

Start TS: 3600000 Timeout: 200 Deadline: 3600200 TS: 3600150 TS: 3600250 TS: 3600000

X

slide-153
SLIDE 153

Deadline propagation

Client Service A

150ms 100 ms

B

DEADLINE_EXCEEDED Start TS: 3600000 Timeout: 200 Deadline: 3600200 TS: 3600150 TS: 3600250 TS: 3600000

X

slide-154
SLIDE 154

Deadline propagation

Client Service A

150ms 100 ms

B

DEADLINE_EXCEEDED DEADLINE_EXCEEDED Start TS: 3600000 Timeout: 200 Deadline: 3600200 TS: 3600150 TS: 3600250 TS: 3600000

X

slide-155
SLIDE 155

Cancellation

slide-156
SLIDE 156

Cancellation

– Can be initiated by both client/server

slide-157
SLIDE 157

Cancellation

– Can be initiated by both client/server – Immediately terminates the RPC

slide-158
SLIDE 158

Cancellation

– Can be initiated by both client/server – Immediately terminates the RPC – It is not a roll-back

slide-159
SLIDE 159

Cancellation

– Can be initiated by both client/server – Immediately terminates the RPC – It is not a roll-back – Automatically cascaded

slide-160
SLIDE 160

Backward compatibility

https://github.com/grpc-ecosystem/grpc-gateway

slide-161
SLIDE 161

gRPC language support

– C++ – Python – Java – Go – Ruby – C# – JS (Node) – Android Java – Objective-C – PHP

slide-162
SLIDE 162

gRPC Platform support

– Linux – macOS – Windows – Android – iOS

slide-163
SLIDE 163

Success stories

slide-164
SLIDE 164

Success stories

slide-165
SLIDE 165

Benefits

slide-166
SLIDE 166

Benefits

–Focus on the API design & contract

slide-167
SLIDE 167

Benefits

–Focus on the API design & contract –HTTP2 is awesome

slide-168
SLIDE 168

Benefits

–Focus on the API design & contract –HTTP2 is awesome –Bi-directional streaming

slide-169
SLIDE 169

Benefits

–Focus on the API design & contract –HTTP2 is awesome –Bi-directional streaming –Freedom to pick any language

slide-170
SLIDE 170

Benefits

–Focus on the API design & contract –HTTP2 is awesome –Bi-directional streaming –Freedom to pick any language –Service-to-Service and Service-to-Mobile friendly

slide-171
SLIDE 171

Benefits

–Focus on the API design & contract –HTTP2 is awesome –Bi-directional streaming –Freedom to pick any language –Service-to-Service and Service-to-Mobile friendly –Production ready

slide-172
SLIDE 172

Fin.

Thank you.