❔ GRPC design oneof or separate Rpc
Hi there,
I have a system which i'm trying to expose via GRPC protobufs.
Assume we have 5 different types of records with some shared fields and some custom fields in each record type.
At the moment i can think of exposing it like this:
message Record
{
string id = 1;
string shared_field1 = 2;
string shared_field2 = 3;
oneof <type1_fields, type2_fields, type3_fields> custom_fields = 4;
}
The other option is for a separate message per record type which includes the custom fields in each.
3 Replies
What's the question?
Oopsies i missed adding the actual question.
What is the better option for my use case?
Looks like nothing has happened here. I will mark this as stale and this post will be archived until there is new activity.