Home/Glossary/Data Serialization

Data Serialization

The process of converting data structures into a format that can be stored or transmitted and reconstructed later.

Data FormatsAlso called: "serialization", "data marshalling"

Serialization enables data to be saved, sent over networks, or shared between systems.

Common formats

  • JSON: Human-readable, web-standard (JavaScript Object Notation).
  • XML: Verbose but flexible (eXtensible Markup Language).
  • CSV: Simple tabular data (Comma-Separated Values).
  • Binary: Protocol Buffers, MessagePack (efficient, compact).
  • YAML: Human-friendly configuration (YAML Ain't Markup Language).

Use cases

  • Saving application state to disk.
  • Sending data over HTTP APIs.
  • Inter-process communication.
  • Database storage.
  • Configuration files.

Considerations

  • Performance: Binary formats are faster, text formats are debuggable.
  • Size: Compression vs readability tradeoff.
  • Compatibility: Cross-language support.
  • Security: Deserialize untrusted data carefully (injection risks).