gRPC

gRPC

July 8, 2024 | seedling, permanent

tags :

Protocol #

A high performance, Open Source universal RPC framework URL

  • Acronym: Google Remote Procedure Call

  • gRPC is a modern open source high performance Remote Procedure Call (RPC) framework that can run in any environment. It can efficiently connect services in and across data centers with pluggable support for load balancing, tracing, health checking and authentication. It is also applicable in last mile of distributed computing to connect devices, mobile applications and browsers to backend services.

gRPC is a CNCF incubation project

Use Cases #

Good for inter-service communication synchronous within microservices

Supported languages #

Select a language to get started:

REST vs gPRC #

AttributegRPC APIREST API
What is it?A framework for creating APIs based on the RPC (Remote Procedure Call) model.A set of rules for structuring data exchange between client and server.
Design ApproachService-oriented. Requests the server to perform a service, affecting or not affecting resources.Entity-oriented. Requests involve creating, sharing, or modifying resources.
Communication ModelSupports unary, server-streaming, client-streaming, and bidirectional streaming.Primarily unary, involving single requests and responses.
ImplementationRequires gRPC software on both client and server.Can be implemented in various formats, no common software necessary.
Data AccessAccessed through service (function) calls.Accessed through multiple URL endpoints representing resources.
Data ReturnedFixed return type as defined in the Protocol Buffer file.Typically in a fixed structure like JSON, defined by the server.
Client-Server CouplingTightly coupled, needs the same Protocol Buffer file on both client and server.Loosely coupled; client and server need not be aware of each other’s internal details.
Code GenerationHas built-in support for automatic code generation.Typically requires third-party tools for automatic code generation.
Bidirectional StreamingSupports bidirectional streaming.Does not support bidirectional streaming.
Best Suited forHigh-performance, data-heavy microservice architectures.Simple, well-defined resource-based services.


No notes link to this note