Proto enum growing reserved list

77 views
Skip to first unread message

Agnivah Poddar

unread,
Oct 5, 2022, 6:01:48 PM10/5/22
to Protocol Buffers
Hi all,

I am designing a new framework for my team wherein I introduce a new Proto message that is uniquely identified by a proto enum value. 

message FooId {
  enum Id {
   ...
  }
}

message Foo {
  optional FooId.Id = 1;
  ...
}


The configs are supposed to be short-lived. The way this is intended to be used is that a client can grab a new enum value and use that in their configuration. Afterwards, they can clean up the config and mark the enum value as reserved. One concern I have is that over time, the list of reserved values will grow too large along with the new enum values making it wasteful(?). Is there a different approach I can take here for my use-case? 

Thanks,

Jerry Berg

unread,
Oct 6, 2022, 12:24:52 PM10/6/22
to Protocol Buffers
If the ID's are short lived, you might find string IDs to be better suited. How are the configs being defined, TextFormat? Or some other way?
Reply all
Reply to author
Forward
0 new messages