Thursday, May 03, 2018

FlatBuffers vs JSON

For sending data over HTTP first there was XML, then JSON,
sometimes Protocol Buffers, and now FlatBuffers, and possible "next thing" :)

Most of Google's (and other) services are internally running on Protocol Buffers.
FlatBuffers is simplified, faster version of Protocol Buffers format.

FlatBuffers: FlatBuffers

"FlatBuffers is an efficient cross platform serialization library for C++, C#, C, Go, Java, JavaScript, TypeScript, PHP, and Python. It was originally created at Google for game development and other performance-critical applications. It is available as Open Source on GitHub under the Apache license, v2"

"FlatBuffers is a free software library implementing a serialization format similar to Protocol Buffers, Thrift, Apache Avro, SBE, and Cap'n Proto, primarily written by Wouter van Oortmerssen and open-sourced by Google

Like Cap'n Proto and SBE, it supports “zero-copy” deserialization, so that accessing the serialized data does not require first copying it into a separate part of memory, which makes accessing data in these formats much faster than data in formats requiring more extensive processing, such as JSON, CSV, and Protocol Buffers. 

It is the data serialization format used internally in Facebook's Android client, replacing JSON; in that role, they credit it for dramatic performance improvements in the client.

No comments: