Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

FlatBuffers vs. Protobuf

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?

like image 567
NEO Avatar asked Feb 01 '19 11:02

NEO


People also ask

What is faster than Protobuf?

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.

What are FlatBuffers used for?

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.

Is Protobuf more efficient than JSON?

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.

Does Google use Protobuf?

Protocol buffers are Google's language-neutral, platform-neutral, extensible mechanism for serializing structured data – think XML, but smaller, faster, and simpler.


1 Answers

There are several reasons for this:

  1. 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.

  2. 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.

like image 187
AKANKSHA PANDEY Avatar answered Sep 28 '22 08:09

AKANKSHA PANDEY