Flat Buffers - Quick Guide



Flat Buffers - Introduction

Before we jump into Flat Buffers, let us go over a brief background of Serialization which is what Flat Buffers does.

What is Serialization and Deserialization?

Whenever we need to persist an object state to memory system, we need serialization. In serialization, we convert the object into bytes and stored the bytes in memory system. These stored bytes can then later be deserialized to get the object state back. As we are converting object to bytes, it can be stored anywhere including file system, messaging queues, databases and so on and then we can transfer these bytes to different machine and retrieve the object state as such.

Why do we need Serialization and Deserialization?

Serialization helps to persist an object state and then we can transfer it to anywhere over the network. Once received, we can deserialized the object or in other words, we can restore our object from bytes on different machine at any time. This is one of the many important use case of Serialization and Deserialization. Another important use case is where object is to be