"Fossies" - the Fresh Open Source Software Archive

Member "flatbuffers-23.1.21/docs/source/FlatBuffers.md" (21 Jan 2023, 9662 Bytes) of package /linux/misc/flatbuffers-23.1.21.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format (assuming markdown format). Alternatively you can here view or download the uninterpreted source code file. A member file download can also be achieved by clicking within a package contents listing on the according byte size field.

FlatBuffers {#flatbuffers_index}

Overview {#flatbuffers_overview}

[FlatBuffers](@ref flatbuffers_overview) is an efficient cross platform serialization library for C++, C#, C, Go, Java, Kotlin, JavaScript, Lobster, Lua, TypeScript, PHP, Python, Rust and Swift. 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 (see LICENSE.txt).

Why use FlatBuffers?

Why not use Protocol Buffers, or .. ?

Protocol Buffers is indeed relatively similar to FlatBuffers, with the primary difference being that FlatBuffers does not need a parsing/ unpacking step to a secondary representation before you can access data, often coupled with per-object memory allocation. The code is an order of magnitude bigger, too. Protocol Buffers has no optional text import/export.

But all the cool kids use JSON!

JSON is very readable (which is why we use it as our optional text format) and very convenient when used together with dynamically typed languages (such as JavaScript). When serializing data from statically typed languages, however, JSON not only has the obvious drawback of runtime inefficiency, but also forces you to write more code to access data (counterintuitively) due to its dynamic-typing serialization system. In this context, it is only a better choice for systems that have very little to no information ahead of time about what data needs to be stored.

If you do need to store data that doesn't fit a schema, FlatBuffers also offers a schema-less (self-describing) version!

Read more about the "why" of FlatBuffers in the [white paper](@ref flatbuffers_white_paper).

Who uses FlatBuffers?

Usage in brief

This section is a quick rundown of how to use this system. Subsequent sections provide a more in-depth usage guide.

In-depth documentation

Online resources