protobuf-net / protobuf-net.Grpc

GRPC bindings for protobuf-net and grpc-dotnet
Other
867 stars 114 forks source link

Versioning of gRPC service / breaking changes in gRPC contract #253

Open espjak opened 2 years ago

espjak commented 2 years ago

Hi,

What is best way to solve breaking changes in the gRPC contract. I had a case recently where I had to change a model that was used by the gRPC service, as in I changed the datatype of a DataMember but name is the same. The server in this case is a micro service that multiple clients are using. Updating the micro service will require all my clients to also update its contract definition, this is not feasible to do all the time.

So what options are there in these cases?

Do you have any input on how to solve this? Or point me to a page, code examples etc. so I can read.

mgravell commented 2 years ago

Data member names aren't critical; only the field numbers - so if you have changed a field, one option might be to have the old field and number with a renamed "FooOld" name, marked [Obsolete], and the new field type and new number as "Foo", allowing your server code to check both. Is that an option? I will have to read the link on versioning to check what that is referring to.

espjak commented 2 years ago

That seems to be an okay solution. I will try it next time. Thanks for input.