Slide 1

Slide 1 text

Building Modern Services with .NET Core 3 and gRPC Greg Shackles VP of Technology, Olo @gshackles [email protected]

Slide 2

Slide 2 text

What Are Worker Services? ▪ Long-running background applications ▪ Some examples: – Queue processor – Event stream processor – Timer-based tasks

Slide 3

Slide 3 text

Creating A Worker Service > dotnet new worker

Slide 4

Slide 4 text

Hosted Services

Slide 5

Slide 5 text

Lifetime Management Microsoft.Extensions.Hosting.Internal.ConsoleLifetime Microsoft.Extensions.Hosting.WindowsServices.WindowsServiceLifetime Microsoft.Extensions.Hosting.Systemd.SystemdLifetime

Slide 6

Slide 6 text

Demo: Worker Services github.com/gshackles/aspnetcore-grpc-demo: samples/RangersPlayoffStatusChecker

Slide 7

Slide 7 text

Introduction to gRPC

Slide 8

Slide 8 text

What is gRPC? ▪ High performance, open source remote procedure call framework – Action-centric vs resource-centric ▪ Cross-platform, supported everywhere in many languages ▪ Automatically generate client SDKs from IDL

Slide 9

Slide 9 text

What is gRPC? ▪ Protocol buffers used for interface definitions and serialization – Compact, efficient binary format – Fast serialization and deserialization – Downside: less human-readable ▪ Built on HTTP/2 – Binary framing and compression: more efficient protocol than HTTP 1.x – Multiplexing: stream multiple calls over a single TCP connection – Flow control: prevent senders from overwhelming receivers

Slide 10

Slide 10 text

Protobuf Primer

Slide 11

Slide 11 text

Creating A gRPC Service > dotnet new grpc

Slide 12

Slide 12 text

Service Definition

Slide 13

Slide 13 text

Making Remote Procedure Calls From C#

Slide 14

Slide 14 text

Unary RPC

Slide 15

Slide 15 text

Server Streaming RPC

Slide 16

Slide 16 text

Client Streaming RPC

Slide 17

Slide 17 text

Bidirectional Streaming RPC

Slide 18

Slide 18 text

Authentication and Authorization

Slide 19

Slide 19 text

Deadlines and Cancellations

Slide 20

Slide 20 text

Interceptors and Middleware

Slide 21

Slide 21 text

Client Factory and Context Propagation

Slide 22

Slide 22 text

Health Checks

Slide 23

Slide 23 text

Health Checks

Slide 24

Slide 24 text

Error Handling

Slide 25

Slide 25 text

Server Reflection

Slide 26

Slide 26 text

Demo: gRPC Services github.com/gshackles/aspnetcore-grpc-demo: samples/HockeyStandings

Slide 27

Slide 27 text

Questions? github.com/gshackles/aspnetcore-grpc-demo