# Data Serialization **Domain:** Data Interchange / Persistence **Doc Type:** Canonical Concept Node **Maturity:** Foundational **Related:** [[wiki/Flattening and Expanding Structures|Flattening and Expanding Structures]], [[wiki/Normalized Output|Normalized Output]], [[wiki/Portable Contract|Portable Contract]] --- ## Definition **Data serialization converts in-memory values or structures into a storable or transmissible representation and reconstructs them later.** A serialization contract defines encoding, escaping, types, ordering, versioning, and failure behavior. ## Project Context KeyDB used a readable pipe-delimited convention with escaping for embedded newlines and delimiters, plus a binary path through Perl's `Storable` when load speed mattered more than direct inspection. The choice illustrates a recurring tradeoff between human readability, portability, and performance. ## Key Insight **A serialized form is durable only when its decoding rules are as well preserved as its bytes.** ## See Also [[wiki/Filesystem as Source of Truth|Filesystem as Source of Truth]], [[wiki/Input Rules|Input Rules]], [[wiki/Error Behavior|Error Behavior]], [[wiki/Technical Terms|Technical Terms]]