Serialization in tech refers to the process of making something storable in a file, which can be passed over a network, and backed up.


Marshalling is a synonym for serialization and has recently found more common usage because of the specificity of the term. “Marshalling” and “unmarshalling” always means taking something in a programs memory and writing it out in a flattened way and taking that flattened data and bringing it back into a program to recreate the exact memory structure of its original.

Serializing to Text

Serializing to JSON text is most common approach today. JSON’s simple standard make is almost as fast as binary data to parse and load and yet it can be understood by the humans using it.

💎 JSON might be good for computers but it is a horrible format for humans. Use YAML or TOML if you are maintaining the data primarily by hand (without any sort of user interface.

Serializing to Binary

While less common, some systems and programs write their memory directly to storage without any attempt to make it readable by humans. This is usually far more efficient.

For example, a network multiplayer game must communicate a lot of data very quickly. The closer that data is to its form that will be used by the game programs used by each player the shorter the time to load (unserialize) it into memory.