Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to share Protobuf definitions for gRPC?

Since you have to share .proto files to define data and services for gRPC, service provider and clients need to access the same .proto files. Is there any common strategy to distribute these files? I want to avoid that every project has its own .proto file in its Git repository and our team members need to manual edit these files or share them via email.

Is there any common best practice?

like image 860
Milgo Avatar asked Apr 30 '19 14:04

Milgo


People also ask

How do you share on Proto?

You can share your Proto.io project using Share links, that is, links that others can access. You can choose to share your prototype as: Live Version: Share a live version of your prototype. Any changes made to your prototype will be visible to the people who access this Share link.

Where are Protobuf files stored?

File format Protobuf binary is stored in the bytes field of AvroBytesRecord . Starting with Scio 0.2. 6, the Protobuf schema also is stored as a JSON string in the Avro file metadata under the key protobuf.

Does gRPC use Protobuf?

Protobuf is the most commonly used IDL (Interface Definition Language) for gRPC. It's where you basically store your data and function contracts in the form of a proto file.

What version of Protobuf does gRPC use?

protoc compiler If you don't have it already, you need to install the protobuf compiler protoc , version 3.5. 0+ (the newer the better) for the current gRPC version.


1 Answers

Unfortunately, there is no common practice, although the main goal that you should achieve is to store proto files in one version control repository.

During my investigation, I've found some interesting blog posts about that subject:

  • https://www.bugsnag.com/blog/libraries-for-grpc-services
  • https://www.crowdstrike.com/blog/improving-performance-and-reliability-of-microservices-communication-with-grpc/
  • https://medium.com/namely-labs/how-we-build-grpc-services-at-namely-52a3ae9e7c35

They covers much of gRPC workflow considerations. Hope that helps!

like image 112
kkochanski Avatar answered Sep 18 '22 09:09

kkochanski