Ben Chuanlong Du's Blog

It is never too late to learn.

Tips on Protobuf

Things on this page are fragmentary and immature notes/thoughts of the author. Please read with your own judgement!

oneof vs enum

Prefer to have oneof with a string field describing the specific type of oneof.

message A { // A here is the "interface".
  string name = 1;
  string a_type = 2; // Or …

Rust Crates for RPC

Things on this page are fragmentary and immature notes/thoughts of the author. Please read with your own judgement!

prost

prost is a Protocol Buffers implementation for the Rust Language. It helps generate simple, idiomatic Rust code from proto2 and proto3 files.

Binary Serialization Format

Things on this page are fragmentary and immature notes/thoughts of the author. Please read with your own judgement!

Summary

  1. Protobuf is best for message serialization. Some companies (e.g., Google) also use it extensively for disk serialization.

  2. FlatBuffers has better CPU performance.

  3. Apache Parquet is the most popular binary …