My question is if FlatBuffers is much faster than Protobuf, why isn't it more widely used compared to Protobuf?
It used to be an experimental thing but it seems to be mature enough now but isn't widely used yet. It seems people mostly use Flatbuffers for mobile apps/games. Why is that the case?
TL;DR — encoding and decoding string-intensive data in JavaScript is faster with JSON than it is with protobuf. When you have structured data in JavaScript, which needs to be sent over the network (for another microservice for example) or saved into a storage system, it first needs to be serialized.
FlatBuffers is a cross platform serialization library architected for maximum memory efficiency. It allows you to directly access serialized data without parsing/unpacking it first, while still having great forwards/backwards compatibility.
JSON is usually easier to debug (the serialized format is human-readable) and easier to work with (no need to define message types, compile them, install additional libraries, etc.). Protobuf, on the other hand, usually compresses data better and has built-in protocol documentation via the schema.
Protocol buffers are Google's language-neutral, platform-neutral, extensible mechanism for serializing structured data – think XML, but smaller, faster, and simpler.
There are several reasons for this:
As you mentioned, flatbuffers are being used mostly in apps and games. This is because this is their best application. Since flatbuffers are faster, their main application would be to use them in low latency applications. And it is gaining popularity in that sector.
When the existing technology works fine, people/organizations, in general, don't want to invest time and resources for a newer technology. I have personally worked on a proof of concept involving flatbuffers for a big organizations. There are many hurdles before the final decision of using the technology is taken. Legacy systems are still using xml and json, let alone thinking about protobufs.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With