Serialization
Pronunciationseer-ee-uh-ly-ZAY-shun
Definition
Serialization turns an object in memory into text or bytes, such as JSON, so it can be saved or sent. Deserialization turns it back into an object.
Where you hear it
In API work, caching, saving data to files, and framework docs, for example serializers in Django REST Framework.
Examples
The API serializes the order into JSON before sending it.
Deserialization failed because a required field was missing.
The cache serializes the user object to JSON before storing it in Redis.
Common mistake
Deserializing data you do not trust with a format that can run code, such as Python's pickle. Prefer a plain format like JSON.
Don't confuse with
Validation, which checks that data is correct. Serialization only changes its form.
Say it at work
- In a meeting or chat
Add a serializer so the model can be returned as JSON.
- In an email or ticket
Keep the stored format stable, or old data won't deserialize.
Keep exploring
More in Programming Fundamentals