ProtoBuf v2/v3 wire compatibility

5,675 views
Skip to first unread message

Mike Heffner

unread,
Mar 24, 2015, 2:12:37 PM3/24/15
to prot...@googlegroups.com
Hi,

I haven't been able to find any documentation that explicitly states whether the wire (binary) format of Protobuf v2 messages are compatible with protobuf messages generated with v3 (using `syntax=proto2`). The only documentation seems to mention API differences between the two library versions.

We use protobuf-java and would like to transition from PB v2->v3, but only for new message types. We would like systems that use protobuf-java v2 and protoc v2 generated messages to be able to communicate with systems using protobuf-java v3 and protoc v3 generated messages (and vice versa). It stands to reason that messages that use `syntax=proto3` are not guaranteed to work in this fashion, but I'm curious about messages marked as proto2.


Thanks,

Mike




Feng Xiao

unread,
Mar 24, 2015, 2:21:29 PM3/24/15
to Mike Heffner, prot...@googlegroups.com
Proto2 and proto3 are wire compatible. The same construct in proto2 and proto3 will have the same binary representation. If your proto only uses features available in both proto2 and proto3, systems built with proto2 should be able to communicate with systems built with proto3 without any problem (it's also true vice versa).

--
You received this message because you are subscribed to the Google Groups "Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to protobuf+u...@googlegroups.com.
To post to this group, send email to prot...@googlegroups.com.
Visit this group at http://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages