Original author(s) | Wouter van Oortmerssen |
---|---|
Developer(s) | Derek Bailey |
Initial release | June 17, 2014; 10 years ago (2014-06-17)[1] |
Stable release | |
Repository | |
Written in | C++ |
Operating system | Android,Microsoft Windows,Mac OS X,Linux |
Type | serialization format and library,IDL compiler |
License | Apache License 2.0 |
Website | flatbuffers.dev |
FlatBuffers is afree softwarelibrary implementing aserialization format similar toProtocol Buffers,Thrift,Apache Avro,SBE, andCap'n Proto, primarily written by Wouter van Oortmerssen and open-sourced byGoogle. It supports “zero-copy” deserialization, so that accessing the serialized data does not require first copying it into a separate part of memory. This makes accessing data in these formats much faster than data in formats requiring more extensive processing, such asJSON,CSV, and in many cases Protocol Buffers. Compared to other serialization formats however, the handling of FlatBuffers requires usually more code, and some operations are not possible (like some mutation operations).
Theserialized format allowsrandom access to specific data elements (e.g. individual string or integer properties) without parsing all data. Unlike Protocol Buffers, which usesvariable length integers, FlatBuffers encodes integers in their native size, which favors performance but leads to longer encoded representations.
FlatBuffers can be used in software written inC++,C#,C,Go,Java,JavaScript,Kotlin, Lobster,Lua,PHP,Python,Rust,Swift, andTypeScript. The schema compiler runs onAndroid,Microsoft Windows,macOS, andLinux,[3] but games and other programs use FlatBuffers for serialization work on many other operating systems as well, includingiOS,Amazon'sFire OS, andWindows Phone.[4]
Van Oortmerssen originally developed FlatBuffers for game development and similar applications.[5][1]
Although FlatBuffers has its owninterface definition language to define the data to be serialized with it, it also supports schemas defined in the Protocol Buffers .proto format.[6]
Some notable users of FlatBuffers:
We tested flatbuffers [sic] on all major mobile platforms (iOS, Android, Amazon Os [sic], Windows Phone) we're building on[,] and it works pretty well.
FlatBuffers is an efficient cross platform serialization library for C++, C#, C, Go, Java, JavaScript, PHP, and Python. It was originally created at Google for game development and other performance-critical applications.
Story load time from disk cache is reduced from 35 ms to 4 ms per story. Transient memory allocations are reduced by 75 percent. Cold start time is improved by 10-15 percent. We have reduced storage size by 15 percent.