Serialization
ELI5 — The Vibe Check
Serialization is turning a complex object in your code (like a User with methods and nested data) into a flat format that can be sent over the internet, like JSON. It's like packing a 3D object into a flat box for shipping — you flatten it so it can travel.
Real Talk
Serialization is the process of converting a data structure or object into a format that can be transmitted or stored — most commonly JSON or binary formats. The reverse process is deserialization. It's essential for all network communication.
Show Me The Code
// Serialization: object → JSON string
const json = JSON.stringify({ id: 1, name: 'Alice' });
// → '{"id":1,"name":"Alice"}'
// Deserialization: JSON string → object
const obj = JSON.parse(json);
When You'll Hear This
"Serialize the response before sending it." / "The serializer strips out password fields automatically."
Related Terms
Deserialization
Deserialization is the opposite of serialization — it's unpacking the flat box (JSON) back into a real usable object in your code.
JSON (JavaScript Object Notation)
JSON is the universal language the internet uses to pass data around. It looks like a JavaScript object — curly braces, key-value pairs.
Payload
Payload is the actual data carried in a request or response — the valuable cargo.
Response
A response is what the server sends back after receiving a request.