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?
1 Answers
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.
(Updated in 2021:) Note that Protobufs was introduced at Google way back in 2001 or so and remains the "lingua franca" there today. FlatBuffers was introduced in 2014 and is used in some projects, but Protobuf remains Google's main data interchange format, and there is no intention to change that. To be fair, Google probably couldn't change this if they wanted to, there's just too much code.

- 41,353
- 8
- 121
- 105
-
Hi, Mr. Varda, thank you very much for comments! And thanks for these very helpful open-source tools! As a regular user, I use the great `Protocol Buffers` in the projects. After checking the news about `FlatBuffers` and the project in `Github`, I found it is experimental as you said and isn't very hot, so I also searched the performance comparison between the `PB` and `FB` and posted this question. Thank you for the comparison! It means a lot! And I can't agree more with the `benchmark` section in your post `the relative performance of these libraries depends deeply on the use case`. – mining Aug 19 '14 at 00:08
-
11it might not be widely adopted but the benchmark looks pretty good. The open source gaming library cocos2d-x is using it successfully now. I think Flatbuffer has passed the experimental phase – user18853 Jan 03 '16 at 17:22
-
3@KentonVarda, any new updates for comparisons with FlatBuffers since June 2014? – TJR Jan 07 '16 at 19:48
-
@TJR: I haven't kept up with it. Probably a bunch has changed. I'm happy to incorporate any updates if someone informs me what should be updated. – Kenton Varda Jan 08 '16 at 17:39
-
13Flatbuffers are used by Facebook within their Android application, according to [this article](https://code.facebook.com/posts/872547912839369/improving-facebook-s-performance-on-android-with-flatbuffers/). – Alex Che May 04 '17 at 09:47
-
4@KentonVarda : Hi Kenton, would be really happy if you could please provide an update to this answer, as `flatbuffers` are used quite a lot these days, such as in **tensorflow lite**, we have the tensorflow protobuf files, but also tensorflow lite flatbuffers with their smaller sizes, and it would help to know pros and cons here on SO to be able to understand, which one is more suited for a particular usecase and also a comparison with Cap'n Proto too, especially against flatbuffers for mobile devices, thanks! – aspiring1 Aug 10 '20 at 11:18
-
@aspiring1 I've added a small disclaimer on the top! For others, it seems that FlatBuffers is the goto for most use cases. Homepage: https://google.github.io/flatbuffers/ – Hugo Gresse Sep 20 '21 at 09:39
-
1@HugoGresse I removed your edit and made a different edit to remove the assertion that FlatBuffers is "experimental" and is used in some projects, but clarify that Protobuf is still very much the lingua franca inside Google. If someone wants to submit a better answer to this question, they are welcome to do so. – Kenton Varda Sep 21 '21 at 21:38
-
perfect Kanton! thanks. – Hugo Gresse Sep 22 '21 at 12:55