Deserialization converts a serialized representation back into an in-memory data structure that application code can access. It commonly follows network transport or storage, such as turning JSON from a REST API request into an order object. section 7.3
Treat deserialization as application work when optimizing latency. The transformation consumes CPU cycles and may require expensive memory copies, so measure where it occurs and avoid redundant format conversions when possible. A service may deserialize JSON for processing, then serialize the same order again for storage or a binary RPC format such as Protocol Buffers. section 7.1 section 7.3
Order data across an API
An order represented in memory as a Rust struct with orderId and quantity arrives as JSON. Deserialization reconstructs the in-memory representation from that JSON; the reverse operation serializes the struct for transport or storage. The example also exposes the byte-level transformation of a 32-bit orderId using little-endian storage. section 7.3
Figure 7.2 Serialization transforms the in-memory representation of data (shown on the left as a Rust struct) to a serialized format such as JSON (shown on the right). Deserialization performs the opposite transformation from a serialized format to an in-memory representation.
Use the figure to compare the Rust struct, serialized JSON, and opposite-direction deserialization transformation. section 7.3









