gRPC Service with .NET 7
In this video we build a gRPC service with 5 methods: Create, Read (single), List (multiple), Update and Delete. We then employ JSON transcoding (a new feature added in .NET 7) to allow our gRPC service to act as a REST based API. This allows web-based endpoints to consume our service, while at the same time continuing to allow native gRPC clients to consume as well.
⏲️ Time Codes ⏲️
- 0:33 - Welcome
- 2:00 - gRPC Overview
- 5:08 - Scaffold the prject
- 9:58 - Test "greeter" service with Postman
- 12:32 - Add package dependencies
- 14:48 - Create the Model
- 16:38 - Create DB Context & migrations
- 22:37 - Define the protobuf file
- 32:39 - Build the first service method
- 40:55 - Test method with postman
- 42:52 - Read method
- 48:42 - List method
- 52:39 - Update method
- 59:14 - Delete method
- 1:03:24 - Add the annotation files
- 1:06:07 - Annotate the first gRPC method
- 1:09:26 - Annotate remaining methods
- 1:12:42 - Test with Postman
- 1:16;00 - Patreon supporter credits
One repo to finally have a clear, objective gRPC benchmark with code for everyone to verify and improve.
OS: Fedora release 38 (Thirty Eight) x86_64
Host: Z790 UD AX
Kernel: 6.3.6-200.fc38.x86_64
CPU: 13th Gen Intel i9-13900KF (32) @ 5.500GHz
GPU: NVIDIA GeForce RTX 4090
Memory: 64119MiB
| java_vertx_grpc | 201739 | 4.93 ms | 5.57 ms | 6.60 ms | 10.70 ms | 96.63% | 109.0 MiB |
| dotnet_grpc | 189382 | 4.97 ms | 5.74 ms | 6.58 ms | 50.39 ms | 99.59% | 239.78 MiB |
| rust_thruster_st | 189079 | 5.26 ms | 5.70 ms | 5.97 ms | 6.76 ms | 94.39% | 17.51 MiB |
| rust_thruster_mt | 186403 | 5.34 ms | 2.33 ms | 2.75 ms | 137.25 ms | 93.78% | 19.33 MiB |
| rust_tonic_st | 181329 | 5.49 ms | 5.96 ms | 6.21 ms | 6.59 ms | 94.35% | 18.31 MiB |
| rust_grpcio | 177021 | 5.63 ms | 6.27 ms | 6.48 ms | 7.01 ms | 77.65% | 229.43 MiB |
| cpp_grpc_mt | 175054 | 5.69 ms | 6.59 ms | 6.88 ms | 7.52 ms | 76.31% | 20.13 MiB |
| cpp_grpc_st | 174633 | 5.70 ms | 6.45 ms | 6.69 ms | 7.30 ms | 76.07% | 9.99 MiB |
| cpp_asio_grpc | 170664 | 5.84 ms | 6.65 ms | 6.94 ms | 7.55 ms | 77.04% | 20.75 MiB |
| rust_tonic_mt | 161976 | 6.15 ms | 2.65 ms | 2.92 ms | 175.00 ms | 88.21% | 21.83 MiB |
پیاده سازی معماری میکروسرویس در دات نت با استفاده از ابزار های
Ocelot For Api Getway
RabbitMQ For Message Broker
JWT Token For Authentication And Authorization
SQL Server And MongoDB For Databases
ASP Core Web Api For Our Rest Api And Swagger As Open API
Google RPC (GRPC) For Transfer Data Between Microservice
Docker For Run Database Services ( SQL Server , MongoDB ) And Message Broker ( RabbitMQ )
.NET Microservices – Full Course, Les Jackson
In this step-by-step tutorial I take you through an introduction on building microservices using .NET. As the name suggests we build everything completely from start to finish –with the full scope of the course outlined in the time-stamp section below. However, at a high-level we’ll cover:
• Building two .NET Microservices using the REST API pattern
• Working with dedicated persistence layers for both services
• Deploying our services to Kubernetes cluster
• Employing the API Gateway pattern to route to our services
• Building Synchronous messaging between services (HTTP & gRPC)
• Building Asynchronous messaging between services using an Event Bus (RabbitMQ)