Systems & Backend

Serialization

also: deserialization · marshalling

Turning an in-memory object into bytes to store or send it — and deserialization turns it back.

Serialization is converting an in-memory data structure into a flat sequence of bytes so it can be stored on disk or sent over the network; deserialization reconstructs the object on the other side. Formats include JSON (text, human-readable) and Protocol Buffers or Avro (binary, compact).

Worked example: an API serializes a user object to JSON to send in a response; a message queue serializes events to Protobuf for compactness; the receiver deserializes back into objects. Gotcha: serialization is a top source of bugs and vulnerabilities — schema changes can break old consumers (a renamed field), and deserializing untrusted input can execute code in some languages (insecure deserialization) — which is why binary formats use explicit, versioned schemas and you never deserialize untrusted data into arbitrary types.