-
Notifications
You must be signed in to change notification settings - Fork 374
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow oneof
in our protobuf gRPC interfaces?
#8588
Comments
This assumption seems worth questioning. I believe that interlacing blueprint commands + recording data in a single rerun-stream is a significant contributor to complexity of our protocol. Why can't these simply exist as two parallel streams at the grpc-layer? Send blueprint commands over a blueprint control interface, and send recording data over a chunk streaming interface. |
As far as I understand, that is definitely the long-term plan, but we've decided not to do that yet, and keep the |
See also rerun/crates/store/re_log_types/src/lib.rs Lines 274 to 279 in 9699349
|
After some discussion we've decided to allow |
This is a design-decision we need to take on our design of our protobuf/gRPC messages:
oneof
in some places?What is
oneof
oneof
is a feature for implementing sum-types in probufs (see oneof docs).Why not use
oneof
A common complaint of
oneof
is that it produces complex serializer/deserializer code in languages that don't support sum-types… which is almost all languages, except Rust.Another drawback of
oneof
is that one needs to be careful when adding/removing variants, but I think that goes for most of the alternatives to it too (see below).What do we want to use
oneof
for?We want to use them for messages from our log API to the viewer. These messages are one of:
SetStoreInfo
ArrowMsg
(a chunk)BlueprintCommand
We need the ordering of blueprint commands and chunks to be predictable, so we cannot use separate streams for these.
We will also store these messages as protobufs in our .rrd files.
Alternatives
We have these:
How do we send them over a single stream?
The two streams we care about are:
.rrd
filesgRPC
streamsIdeally we pick the same solution for both.
Using
oneof
PRO: simple for Rust users (us)
CON: difficult for non-Rust users (others)
It could make it harder for others to write parsers of
.rrd
files in non-Rust languages. Do we even care?NOTE: this does NOT affect how we store data in our indexed database files (which will likely use Lance or similar).
Optional fields
PRO: simple
CON: what happens if more than one field is set?
Roll-your-own
CON: a bit silly to have a protobuf inside a protobuf
The text was updated successfully, but these errors were encountered: