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

Preface

This book explains how to use all the fundamental components of gRPC on .NET. As well as covering the core technical functionality of gRPC, this book also explains the best practices of using it.

gRPC is an efficient mechanism of communication over the web that was originally developed by Google. It has now been accepted as one of the web standards. As it runs over HTTP/2, it is much faster than the standard HTTP communication. gRPC is especially suitable for facilitating direct communication between microservices inside a distributed application.

RPC stands for remote procedure call, so applying it in the code to call endpoints on a remote server is just as easy as calling functions and methods inside an application. gRPC is standardized, so it's possible to find a suitable implementation of it in any modern programming language. Your distributed application does not have to have every component written in the same language. All services will still work together, regardless of which language they are written in.

Developers working with .NET will be able to put their knowledge to work with this practical guide to using gRPC. This book provides a hands-on approach to the implementation and the associated methodologies and will have you up and running and productive in no time. You'll start with the fundamentals of gRPC and how to use it inside .NET apps. Along with learning technical details, you'll explore best practices for performance and more. Next, you'll focus on scaling a gRPC app. Finally, you'll use different call types that gRPC supports and apply authentication and authorization to gRPC endpoints.

By the end of this book, you will be able to use gRPC in .NET applications to enable direct communication between microservices.