SlideShare a Scribd company logo
1 of 19
Download to read offline
gRPC says Hi to
.NET
Yu-Lang Chu
.NET Developer from APIs to APIs
WCFRest OData
gRPCRest GraphQL
.NET 4.X
.NET 5
gRPC in .NET
● Developed at Google in 2015
● CNCF project
● Official support .NET core 3.0
● Replace WCF in .NET ecosystem
What is gRPC:
General-purpose Remote Procedure Calls
Latest new technologies
C# Service
gRPC Server
JS Client
gRPC Client
stub
Python Client
gRPC Client
stub
HTTP/2
Protobuf
Interoperability
Rest API vs gRPC
● Resource/Content first - JSON
● Human Readable content - JSON
● Text serialization - JSON
● HTTP verbs
● Contract first - protobuf
● Human Readable contract - protobuf
● Binary serialization - protobuf
● No limitation to verbs
https://martin.kleppmann.com/2012/12/05/schema-evolution-in-avro-protocol-buffers-thrift.html
Performance: Protobuf vs XML vs JSON
https://digitallife.rocks/2019/05/30/how-to-save-money-with-technology-protobuf/
Protobuf : core of gRPC
GeneratorProtobuf
C# class
Python class
Golang struct
Message
Protobuf vs WCF
https://docs.microsoft.com/en-us/dotnet/architecture/grpc-for-wcf-developers/migrate-request-reply
Definition of Protobuf
Syntax version
options
package(protobuf)
Service definition
Message
Types of method: WCF vs gRPC
https://docs.microsoft.com/en-us/dotnet/architecture/grpc-for-wcf-developers/rpc-types
4 type of service method
client server
client server
client server
client server
Unary
Client Streaming
Server Streaming
Bidirectional
Streaming
Scenarios
Feature: low latency, high throughput, stream, cross-platform
4 recommended scenarios:
● Microservice
● Point-to-point real time communication
● Multi-language environments
● Network constrained environments
Demo: how to start GRPC project
How to create gRPC server project
● VS2019:
● Command line : dotnet new grpc
● Existing project:
○ add package Grpc.AspNetCore
○ Startup.cs: Add gRPC services and endpoint
How to create gRPC Client project
Project setup:
1. Install Packages:
● Google.Protobuf
● Grpc.Net.Client
● Grpc.Tools
2. Add Protobuf files reference into .csproj, then build project
Code:
3. Setup channel: var channel = Grpc.channel.ForAddress(...);
4. Call defined API
More Topics
● Protobuf definition
● Authentication/Authorization
● Cache
● Rate limiting
● GRPC web
● ….. etc
Reference
● https://developers.google.com/protocol-buffers
● https://docs.microsoft.com/en-us/dotnet/architecture/grpc-for-wcf-developers/
● https://grpc.io/
● https://github.com/grpc/grpc-dotnet

More Related Content

What's hot

REST - Representational state transfer
REST - Representational state transferREST - Representational state transfer
REST - Representational state transfer
Tricode (part of Dept)
 
Building high performance microservices in finance with Apache Thrift
Building high performance microservices in finance with Apache ThriftBuilding high performance microservices in finance with Apache Thrift
Building high performance microservices in finance with Apache Thrift
RX-M Enterprises LLC
 

What's hot (20)

REST vs gRPC: Battle of API's
REST vs gRPC: Battle of API'sREST vs gRPC: Battle of API's
REST vs gRPC: Battle of API's
 
Building microservices with grpc
Building microservices with grpcBuilding microservices with grpc
Building microservices with grpc
 
gRPC with java
gRPC with javagRPC with java
gRPC with java
 
gRPC - RPC rebirth?
gRPC - RPC rebirth?gRPC - RPC rebirth?
gRPC - RPC rebirth?
 
Robert Kubis - gRPC - boilerplate to high-performance scalable APIs - code.t...
 Robert Kubis - gRPC - boilerplate to high-performance scalable APIs - code.t... Robert Kubis - gRPC - boilerplate to high-performance scalable APIs - code.t...
Robert Kubis - gRPC - boilerplate to high-performance scalable APIs - code.t...
 
Introduction to gRPC: A general RPC framework that puts mobile and HTTP/2 fir...
Introduction to gRPC: A general RPC framework that puts mobile and HTTP/2 fir...Introduction to gRPC: A general RPC framework that puts mobile and HTTP/2 fir...
Introduction to gRPC: A general RPC framework that puts mobile and HTTP/2 fir...
 
Power-up services with gRPC
Power-up services with gRPCPower-up services with gRPC
Power-up services with gRPC
 
What is gRPC introduction gRPC Explained
What is gRPC introduction gRPC ExplainedWhat is gRPC introduction gRPC Explained
What is gRPC introduction gRPC Explained
 
Rest web services
Rest web servicesRest web services
Rest web services
 
Building your First gRPC Service
Building your First gRPC ServiceBuilding your First gRPC Service
Building your First gRPC Service
 
OpenAPI and gRPC Side by-Side
OpenAPI and gRPC Side by-SideOpenAPI and gRPC Side by-Side
OpenAPI and gRPC Side by-Side
 
Build microservice with gRPC in golang
Build microservice with gRPC in golangBuild microservice with gRPC in golang
Build microservice with gRPC in golang
 
gRPC vs REST: let the battle begin!
gRPC vs REST: let the battle begin!gRPC vs REST: let the battle begin!
gRPC vs REST: let the battle begin!
 
REST - Representational state transfer
REST - Representational state transferREST - Representational state transfer
REST - Representational state transfer
 
What is REST API? REST API Concepts and Examples | Edureka
What is REST API? REST API Concepts and Examples | EdurekaWhat is REST API? REST API Concepts and Examples | Edureka
What is REST API? REST API Concepts and Examples | Edureka
 
Inter-Process Communication in Microservices using gRPC
Inter-Process Communication in Microservices using gRPCInter-Process Communication in Microservices using gRPC
Inter-Process Communication in Microservices using gRPC
 
Restful web services ppt
Restful web services pptRestful web services ppt
Restful web services ppt
 
REST & RESTful Web Services
REST & RESTful Web ServicesREST & RESTful Web Services
REST & RESTful Web Services
 
Rest API
Rest APIRest API
Rest API
 
Building high performance microservices in finance with Apache Thrift
Building high performance microservices in finance with Apache ThriftBuilding high performance microservices in finance with Apache Thrift
Building high performance microservices in finance with Apache Thrift
 

Similar to gRPC

Similar to gRPC (20)

Microservices summit talk 1/31
Microservices summit talk   1/31Microservices summit talk   1/31
Microservices summit talk 1/31
 
Cloud native IPC for Microservices Workshop @ Containerdays 2022
Cloud native IPC for Microservices Workshop @ Containerdays 2022Cloud native IPC for Microservices Workshop @ Containerdays 2022
Cloud native IPC for Microservices Workshop @ Containerdays 2022
 
gRPC 프레임워크를 만들며 알아보는 파이썬 - 파이콘2020
gRPC 프레임워크를 만들며 알아보는 파이썬  - 파이콘2020gRPC 프레임워크를 만들며 알아보는 파이썬  - 파이콘2020
gRPC 프레임워크를 만들며 알아보는 파이썬 - 파이콘2020
 
Cloud Native API Design and Management
Cloud Native API Design and ManagementCloud Native API Design and Management
Cloud Native API Design and Management
 
Apa itu gRPC_.pptx
Apa itu gRPC_.pptxApa itu gRPC_.pptx
Apa itu gRPC_.pptx
 
Bringing Learnings from Googley Microservices with gRPC - Varun Talwar, Google
Bringing Learnings from Googley Microservices with gRPC - Varun Talwar, GoogleBringing Learnings from Googley Microservices with gRPC - Varun Talwar, Google
Bringing Learnings from Googley Microservices with gRPC - Varun Talwar, Google
 
gRPC services testing
gRPC services testinggRPC services testing
gRPC services testing
 
REST in Peace. Long live gRPC!
REST in Peace. Long live gRPC!REST in Peace. Long live gRPC!
REST in Peace. Long live gRPC!
 
REST in Peace. Long live gRPC!
REST in Peace. Long live gRPC!REST in Peace. Long live gRPC!
REST in Peace. Long live gRPC!
 
Aplicações realtime com gRPC
Aplicações realtime com gRPCAplicações realtime com gRPC
Aplicações realtime com gRPC
 
REST in Peace. Long live gRPC! @ Codineers
REST in Peace. Long live gRPC! @ CodineersREST in Peace. Long live gRPC! @ Codineers
REST in Peace. Long live gRPC! @ Codineers
 
APIdays Helsinki 2019 - gRPC: Lightning Fast, Self-Documenting APIs with Moha...
APIdays Helsinki 2019 - gRPC: Lightning Fast, Self-Documenting APIs with Moha...APIdays Helsinki 2019 - gRPC: Lightning Fast, Self-Documenting APIs with Moha...
APIdays Helsinki 2019 - gRPC: Lightning Fast, Self-Documenting APIs with Moha...
 
gRPC - Fastest Data Transfer Protocol
gRPC - Fastest Data Transfer ProtocolgRPC - Fastest Data Transfer Protocol
gRPC - Fastest Data Transfer Protocol
 
gRPC or Rest, why not both?
gRPC or Rest, why not both?gRPC or Rest, why not both?
gRPC or Rest, why not both?
 
gRPC stack supporting Intel Resource Director technology (RDT)
gRPC stack supporting Intel Resource Director technology (RDT)gRPC stack supporting Intel Resource Director technology (RDT)
gRPC stack supporting Intel Resource Director technology (RDT)
 
The new (is it really ) api stack
The new (is it really ) api stackThe new (is it really ) api stack
The new (is it really ) api stack
 
Bye bye WCF, hello gRPC
Bye bye WCF, hello gRPCBye bye WCF, hello gRPC
Bye bye WCF, hello gRPC
 
REST in Peace. Long live gRPC!
REST in Peace. Long live gRPC! REST in Peace. Long live gRPC!
REST in Peace. Long live gRPC!
 
Google Protocol Buffers + gRPC
Google Protocol Buffers + gRPCGoogle Protocol Buffers + gRPC
Google Protocol Buffers + gRPC
 
Microservices Communication Patterns with gRPC
Microservices Communication Patterns with gRPCMicroservices Communication Patterns with gRPC
Microservices Communication Patterns with gRPC
 

Recently uploaded

Jax, FL Admin Community Group 05.14.2024 Combined Deck
Jax, FL Admin Community Group 05.14.2024 Combined DeckJax, FL Admin Community Group 05.14.2024 Combined Deck
Jax, FL Admin Community Group 05.14.2024 Combined Deck
Marc Lester
 
Team Transformation Tactics for Holistic Testing and Quality (NewCrafts Paris...
Team Transformation Tactics for Holistic Testing and Quality (NewCrafts Paris...Team Transformation Tactics for Holistic Testing and Quality (NewCrafts Paris...
Team Transformation Tactics for Holistic Testing and Quality (NewCrafts Paris...
Lisi Hocke
 

Recently uploaded (20)

Abortion Pill Prices Jane Furse ](+27832195400*)[ 🏥 Women's Abortion Clinic i...
Abortion Pill Prices Jane Furse ](+27832195400*)[ 🏥 Women's Abortion Clinic i...Abortion Pill Prices Jane Furse ](+27832195400*)[ 🏥 Women's Abortion Clinic i...
Abortion Pill Prices Jane Furse ](+27832195400*)[ 🏥 Women's Abortion Clinic i...
 
Prompt Engineering - an Art, a Science, or your next Job Title?
Prompt Engineering - an Art, a Science, or your next Job Title?Prompt Engineering - an Art, a Science, or your next Job Title?
Prompt Engineering - an Art, a Science, or your next Job Title?
 
Jax, FL Admin Community Group 05.14.2024 Combined Deck
Jax, FL Admin Community Group 05.14.2024 Combined DeckJax, FL Admin Community Group 05.14.2024 Combined Deck
Jax, FL Admin Community Group 05.14.2024 Combined Deck
 
Modern binary build systems - PyCon 2024
Modern binary build systems - PyCon 2024Modern binary build systems - PyCon 2024
Modern binary build systems - PyCon 2024
 
Software Engineering - Introduction + Process Models + Requirements Engineering
Software Engineering - Introduction + Process Models + Requirements EngineeringSoftware Engineering - Introduction + Process Models + Requirements Engineering
Software Engineering - Introduction + Process Models + Requirements Engineering
 
Incident handling is a clearly defined set of procedures to manage and respon...
Incident handling is a clearly defined set of procedures to manage and respon...Incident handling is a clearly defined set of procedures to manage and respon...
Incident handling is a clearly defined set of procedures to manage and respon...
 
Navigation in flutter – how to add stack, tab, and drawer navigators to your ...
Navigation in flutter – how to add stack, tab, and drawer navigators to your ...Navigation in flutter – how to add stack, tab, and drawer navigators to your ...
Navigation in flutter – how to add stack, tab, and drawer navigators to your ...
 
BusinessGPT - Security and Governance for Generative AI
BusinessGPT  - Security and Governance for Generative AIBusinessGPT  - Security and Governance for Generative AI
BusinessGPT - Security and Governance for Generative AI
 
Team Transformation Tactics for Holistic Testing and Quality (NewCrafts Paris...
Team Transformation Tactics for Holistic Testing and Quality (NewCrafts Paris...Team Transformation Tactics for Holistic Testing and Quality (NewCrafts Paris...
Team Transformation Tactics for Holistic Testing and Quality (NewCrafts Paris...
 
Your Ultimate Web Studio for Streaming Anywhere | Evmux
Your Ultimate Web Studio for Streaming Anywhere | EvmuxYour Ultimate Web Studio for Streaming Anywhere | Evmux
Your Ultimate Web Studio for Streaming Anywhere | Evmux
 
Weeding your micro service landscape.pdf
Weeding your micro service landscape.pdfWeeding your micro service landscape.pdf
Weeding your micro service landscape.pdf
 
Auto Affiliate AI Earns First Commission in 3 Hours..pdf
Auto Affiliate  AI Earns First Commission in 3 Hours..pdfAuto Affiliate  AI Earns First Commission in 3 Hours..pdf
Auto Affiliate AI Earns First Commission in 3 Hours..pdf
 
Encryption Recap: A Refresher on Key Concepts
Encryption Recap: A Refresher on Key ConceptsEncryption Recap: A Refresher on Key Concepts
Encryption Recap: A Refresher on Key Concepts
 
architecting-ai-in-the-enterprise-apis-and-applications.pdf
architecting-ai-in-the-enterprise-apis-and-applications.pdfarchitecting-ai-in-the-enterprise-apis-and-applications.pdf
architecting-ai-in-the-enterprise-apis-and-applications.pdf
 
Transformer Neural Network Use Cases with Links
Transformer Neural Network Use Cases with LinksTransformer Neural Network Use Cases with Links
Transformer Neural Network Use Cases with Links
 
Novo Nordisk: When Knowledge Graphs meet LLMs
Novo Nordisk: When Knowledge Graphs meet LLMsNovo Nordisk: When Knowledge Graphs meet LLMs
Novo Nordisk: When Knowledge Graphs meet LLMs
 
Automate your OpenSIPS config tests - OpenSIPS Summit 2024
Automate your OpenSIPS config tests - OpenSIPS Summit 2024Automate your OpenSIPS config tests - OpenSIPS Summit 2024
Automate your OpenSIPS config tests - OpenSIPS Summit 2024
 
Workshop - Architecting Innovative Graph Applications- GraphSummit Milan
Workshop -  Architecting Innovative Graph Applications- GraphSummit MilanWorkshop -  Architecting Innovative Graph Applications- GraphSummit Milan
Workshop - Architecting Innovative Graph Applications- GraphSummit Milan
 
From Knowledge Graphs via Lego Bricks to scientific conversations.pptx
From Knowledge Graphs via Lego Bricks to scientific conversations.pptxFrom Knowledge Graphs via Lego Bricks to scientific conversations.pptx
From Knowledge Graphs via Lego Bricks to scientific conversations.pptx
 
GraphSummit Milan - Neo4j: The Art of the Possible with Graph
GraphSummit Milan - Neo4j: The Art of the Possible with GraphGraphSummit Milan - Neo4j: The Art of the Possible with Graph
GraphSummit Milan - Neo4j: The Art of the Possible with Graph
 

gRPC