GRPC Concepts: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
 
(11 intermediate revisions by the same user not shown)
Line 2: Line 2:
=Internal=
=Internal=
* [[Grpc#Subjects|gRPC]]
* [[Grpc#Subjects|gRPC]]
=TODO=
<font color=darkkhaki>
* Take the O’Reilly gRPC class by the same author who wrote Protocol Buffers: https://learning.oreilly.com/course/grpc-golang-master/9781838555467/
</font>
=Overview=
=Overview=


gRPC is a RPC framework that uses HTTP/2 as transport protocol and [[Protocol Buffers]] as serialization format.
gRPC is a RPC framework that uses HTTP/2 as transport protocol and [[Protocol Buffers]] as data and services definition language and serialization format.


It provides the ability to define RPC services and generate the client and server code for the services. It also offers authentication, context propagation and documentation generation.
It provides the ability to define [[API_Concepts#Overview|APIs]] - RPC services - and generate the client and server code for the services. It also offers authentication, context propagation and documentation generation. It allows for plugging in load balancing, logging and monitoring.


An example of how to use gRPC and Protocol Buffers to implement a microservice API is available in Chapter 5. Synchronous Communication of [[MiGo|Microservices with Go]].
An example of how to use gRPC and Protocol Buffers to implement a microservice API is available in Chapter 5. Synchronous Communication of [[MiGo|Microservices with Go]].
gRPC is part of the [[Cloud_Native_Compute_Foundation|Cloud Native Computing Foundation (CNCF)]]


=gRPC and Protocol Buffer Services=
=gRPC and Protocol Buffer Services=
gRPC generates client and server code for services defined by Protocol Buffers.


See: {{Internal|Protocol_Buffer_Services#Overview|Protocol Buffers Services}}


gRPC generates client and server code for services defined by Protocol Buffers.
=gRPC Services Accessible over REST HTTP API=
 
<font color=darkkhaki>Once the protocol is defined in [[Protocol_Buffer_Concepts#.proto_Files|<code>.proto</code> files]], HttpRule https://cloud.google.com/endpoints/docs/grpc-service-config/reference/rpc/google.api#google.api.HttpRule can be used to make the gRPC services accessible over REST HTTP.
 
This project translates between HTTP JSON and gRPC:  https://pkg.go.dev/github.com/grpc-ecosystem/grpc-gateway
</font>
 
=Dial Options=
 
=Security=
==Authentication==
{{External|https://grpc.io/docs/guides/auth/}}
===Credentials===
Channel credentials, which are attached to a <code>Channel</code>, such as SSL credentials.
 
Call credentials, which are attached to a call.


See: {{Internal|Protocol_Buffer_Services#Overview|Protocol Buffers Services}}
=<tt>metadata.MD</tt>=
=HTTP REST transcoding=
gRPC services can be made accessible as REST HTTP API. This is implemented with HttpRule https://cloud.google.com/endpoints/docs/grpc-service-config/reference/rpc/google.api#google.api.HttpRule

Latest revision as of 01:00, 22 October 2024

External

Internal

TODO

Overview

gRPC is a RPC framework that uses HTTP/2 as transport protocol and Protocol Buffers as data and services definition language and serialization format.

It provides the ability to define APIs - RPC services - and generate the client and server code for the services. It also offers authentication, context propagation and documentation generation. It allows for plugging in load balancing, logging and monitoring.

An example of how to use gRPC and Protocol Buffers to implement a microservice API is available in Chapter 5. Synchronous Communication of Microservices with Go.

gRPC is part of the Cloud Native Computing Foundation (CNCF)

gRPC and Protocol Buffer Services

gRPC generates client and server code for services defined by Protocol Buffers.

See:

Protocol Buffers Services

gRPC Services Accessible over REST HTTP API

Once the protocol is defined in .proto files, HttpRule https://cloud.google.com/endpoints/docs/grpc-service-config/reference/rpc/google.api#google.api.HttpRule can be used to make the gRPC services accessible over REST HTTP.

This project translates between HTTP JSON and gRPC: https://pkg.go.dev/github.com/grpc-ecosystem/grpc-gateway

Dial Options

Security

Authentication

https://grpc.io/docs/guides/auth/

Credentials

Channel credentials, which are attached to a Channel, such as SSL credentials.

Call credentials, which are attached to a call.

metadata.MD

HTTP REST transcoding

gRPC services can be made accessible as REST HTTP API. This is implemented with HttpRule https://cloud.google.com/endpoints/docs/grpc-service-config/reference/rpc/google.api#google.api.HttpRule