4

let's say the .proto files never changes, and we have a client -server system based on TCP, they speak each otehr via protobuf message. Before both client and server is on protobuf version 2.4.1. Now server upgrades to 2.5.0 (first recompile .java file using 2.5.0 protoc exe, than link against 2.5.0 runtime library). But client still work with 2.4.1 version. Can this system still work?

I think it is a common question for a client-server system. I believe it will work, but really I don't find any words about it from google offered document.

hongdiao
  • 39
  • 1

1 Answers1

2

Yes, that should work fine. The only thing that would break it would be if you started using a new feature that doesn't exist in 2.4.1, but it would be impossible to do that without changing the .proto schema, so you are indeed safe against this. Version tolerance is a Big Thing in protobuf; new features (as an example: packed arrays) are always opt in and require .proto changes.

Marc Gravell
  • 1,026,079
  • 266
  • 2,566
  • 2,900