ADR 0004: Serialization Strategy (MsgPack + LZ4 + Streaming)
Status
Superseded by ADR 0007
Context
Serializing Python objects to disk or over the network is often a bottleneck. Standard JSON or Pickle are either slow or insecure/bulky.
Decision
- Use MsgPack for binary efficiency.
- Use LZ4 for ultra-fast compression.
- Use Zero-Bridge Serialization: Direct Python-to-MsgPack transcoding via
serde-transcode, removingserde_jsonand avoiding intermediate Rust/JSON allocations during both read and write.
Consequences
- Positive: Extremely low serialization/deserialization latency.
- Positive: Reduced storage footprint.
- Negative: Dependency on
lz4_flexandrmp_serdecrates. - Negative: Limited to types supported by
pythonize(mostly standard JSON-like types).