Serialization is mainly used to send objects over the network. It is used in RMI, Spring HttpInvoker, and other binary remote method call systems.
Using it for long-term permanent storage is questionable because it is impossible to query, binary and therefore difficult to parse with a simple text editor, and it is difficult to maintain when classes change, and their serialization format changes in this way. Therefore, a more open format (XML, JSON, etc.) is often chosen.
source share