What's the difference between Protocol Buffers and Flatbuffers?

mining picture mining · Aug 18, 2014 · Viewed 41.8k times · Source

Both are serialization libraries and are developed by Google developers. Is there any big difference between them? Is it a lot of work to convert code using Protocol Buffers to use FlatBuffers?

Answer

Kenton Varda picture Kenton Varda · Aug 18, 2014

I wrote a detailed comparison of a few serialization systems, including Protobufs and FlatBuffers, here:

https://kentonv.github.io/capnproto/news/2014-06-17-capnproto-flatbuffers-sbe.html

However, the comparison focuses more on comparing the three new "zero-copy" serialization systems, and includes Protobufs mostly as a reference point. Also, I'm the author of Cap'n Proto, and also the author of Protobufs v2 (I was responsible for open sourcing Protobufs at Google), so the comparison may be biased.

Note that Protobufs is used throughout Google's own services, whereas FlatBuffers is more of an experimental project that as I understand it has not been widely adopted internally.