Persistence vs. Serialization
Let’s start with some definitions. We’ll say that persistence simply means state that outlives the process that created it. And we’ll say that serialization is the process of converting from a domain-specific representation to a representation that can be persisted easily, such as binary, JSON, or XML.
For example, our order-placing workflow implementation is instantiated and run every time an “order form arrived” event occurs. But when the code stops running, we want its output to stay around somehow (“be persisted”) so that other parts of the business can use that data. “Staying around” does not necessarily mean being stored in a proper database—it could be stored as a file or in a queue. And we shouldn’t make ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access