I tried to find some recommendations on the web but could not find anything relevant.
Let's say that I am creating a protocol buffer message that will contain a lot of fields (50+). Is it best to keep all the fields at the same level or to organize them in sub-messages? Is there any impacts on performances for one way or another?
Example:
message myMessage{
string field1 = 1;
string field2 = 2;
....
string fieldn = n;
}
vs
message myMessage{
SubMessage1 groupedfieldsbasedonsomebusinesslogic1 = 1;
SubMessage2 groupedfieldsbasedonsomebusinesslogic2 = 2;
message SubMessage1{
string field1 = 1;
string field2 = 2;
...
string fieldx = x;
}
message SubMessage2{
string fieldxplus1 = x+1;
...
string fieldn = n;
}
}
I am not considering readability so much here as there are pros and cons when deserializing to have flat data or nested data. My question is really focus on the technical impacts.