Book Image

Microservices Communication in .NET Using gRPC

By : Fiodar Sazanavets
Book Image

Microservices Communication in .NET Using gRPC

By: Fiodar Sazanavets

Overview of this book

Explore gRPC's capabilities for faster communication between your microservices using the HTTP/2 protocol in this practical guide that shows you how to implement gRPC on the .NET platform. gRPC is one of the most efficient protocols for communication between microservices that is also relatively easy to implement. However, its official documentation is often fragmented and.NET developers might find it difficult to recognize the best way to map between C# data types and fields in gRPC messages. This book will address these concerns and much more. Starting with the fundamentals of gRPC, you'll discover how to use it inside .NET apps. You’ll explore best practices for performance and focus on scaling a gRPC app. Once you're familiar with the inner workings of the different call types that gRPC supports, you'll advance to learning how to secure your gRPC endpoints by applying authentication and authorization. With detailed explanations, this gRPC .NET book will show you how the Protobuf protocol allows you to send messages efficiently by including only the necessary data. You'll never get confused again while translating between C# data types and the ones available in Protobuf. By the end of the book, you’ll have gained practical gRPC knowledge and be able to use it in .NET apps to enable direct communication between microservices.
Table of Contents (17 chapters)
1
Section 1: Basics of gRPC on .NET
5
Section 2: Best Practices of Using gRPC
9
Section 3: In-Depth Look at gRPC on .NET

Questions

  1. What would you use to encrypt HTTP communication between a client and a server?
    1. SSL
    2. TLS
    3. gRPC
    4. Bearer tokens
  2. Why can't you use the Http1AndHttp2 configuration for an unsecure gRPC port?
    1. You can use Http1AndHttp2 for an unsecure gRPC port.
    2. The port uses either HTTP/1.1 or HTTP/2 and you cannot have both.
    3. With this configuration, unsecure requests are routed to HTTP/1.1.
    4. You cannot use unsecure gRPC ports at all.
  3. Which of the following tools can be used to generate a self-signed certificate?
    1. PowerShell
    2. The .NET CLI
    3. OpenSSL
    4. All of the above
  4. What is the difference between .pfx and .crt files?
    1. They are interchangeable.
    2. They belong to different operating systems.
    3. A .crt file stores the complete certificate chain, while a .pfx file only stores the public key and any related metadata.
    4. A .pfx file stores the complete certificate chain, while a .crt file only stores the public key and any related metadata.
  5. What is a client certificate used for?
    1. For authentication
    2. To store the...