Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visualize gRPC and Protocol Buffers

We are close to 100 .proto files, where every may define around 10 IDL structures (like service or message).

Is there a way to visualize of of them, including references (from one file to other). For example similar to UML class diagram.

Possibly there are configurable visualizer for Java/C++.

Quote from https://developers.google.com/protocol-buffers/docs/overview

Protocol buffers are now Google's lingua franca for data – at time of writing, there are 48,162 different message types defined in the Google code tree across 12,183 .proto files.

I wonder how they handle this.

like image 601
Paul Verest Avatar asked Nov 17 '16 14:11

Paul Verest


People also ask

Does gRPC use protocol buffers?

Working with Protocol BuffersBy default, gRPC uses Protocol Buffers, Google's mature open source mechanism for serializing structured data (although it can be used with other data formats such as JSON). Here's a quick intro to how it works.

What is protocol buffer in gRPC?

Protocol Buffer, a.k.a. 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.

Can you use gRPC without Protobuf?

Fortunately, gRPC is encoding agnostic! You can still get a lot of the benefits of gRPC without using Protobuf.

Which protocol does gRPC use?

gRPC is a technology for implementing RPC APIs that uses HTTP 2.0 as its underlying transport protocol.


Video Answer


2 Answers

https://github.com/seamia/protodot

  • Super easy to use and pretty powerful tool
  • Generates .dot (and .svg/.png if graphviz is installed) files from .proto
  • Discovers all the dependencies and doesn't require all of them to be present
  • Filters by specified resources (messages, rpcs, services, enums)
  • Can generate import dependency graph

like image 98
grayhemp Avatar answered Oct 21 '22 16:10

grayhemp


I have similar problem: I'm trying to read huge amount of protobufs and understand relation between them. It would be very useful to build a visual representation of them to see what's available and how they're connected to each other.

I've found several projects, maybe they would help someone:

  • protoc-gen-uml
  • protobuf2uml
  • schema-uml
  • protoc-gen-doc

Though, for me they didn't worked well for different reasons, but you can try them.

like image 25
grundic Avatar answered Oct 21 '22 18:10

grundic