An old question, but the following information may be useful for posterity.
Of course, you can serialize in any way, including any number of custom methods, but JSON has become an increasingly popular method.
The most obvious benefit of JSON is that it represents objects in the same way as JavaScript object literals, although a little less flexible. However, if you can represent normal data in JavaScript, then JSON is a good match.
The most important feature is that, since it represents objects as well as arrays, it can represent rather complex and hierarchical data.
For one reason or another, JSON has more or less extruded XML as the preferred serialization for sending data between the server and the browser. It is so useful that many languages โโinclude their own JSON functions (e.g. PHP, has better functions called json_encode and json_decode ), as well as some modern databases. I myself found it convenient to use JSON functions to store a more complex data structure in one database field without JavaScript anywhere).
The short answer is yes, for the most part this is a sufficient step to serialize most of the data (not binary). However, this is not necessary as there are alternatives.
Serializing binary data, on the other hand, is now a different story ...
Manngo
source share