Building Modern Services with .NET Core 3 and gRPC

Building Modern Services with .NET Core 3 and gRPC

279b474d14f72e4daa1fc76e6f3c929f?s=128

Greg Shackles

January 06, 2020
Tweet

Transcript

  1. Building Modern Services with .NET Core 3 and gRPC Greg

    Shackles VP of Technology, Olo @gshackles greg@gregshackles.com
  2. What Are Worker Services? ▪ Long-running background applications ▪ Some

    examples: – Queue processor – Event stream processor – Timer-based tasks
  3. Creating A Worker Service > dotnet new worker

  4. Hosted Services

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

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

  7. Introduction to gRPC

  8. 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
  9. 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
  10. Protobuf Primer

  11. Creating A gRPC Service > dotnet new grpc

  12. Service Definition

  13. Making Remote Procedure Calls From C#

  14. Unary RPC

  15. Server Streaming RPC

  16. Client Streaming RPC

  17. Bidirectional Streaming RPC

  18. Authentication and Authorization

  19. Deadlines and Cancellations

  20. Interceptors and Middleware

  21. Client Factory and Context Propagation

  22. Health Checks

  23. Health Checks

  24. Error Handling

  25. Server Reflection

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

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