|
XML |
JSON |
PB |
Lua |
Data structure support |
Complex Structure |
Simple Structure |
Complex Structure |
Complex Structure |
Data Storage Method |
Text |
Text |
Binary |
Text |
Data storage size |
Large |
Average |
Small |
Average |
Resolution Efficiency |
Slow |
Average |
Fast |
Faster |
Language Support level |
Many |
Multiple |
C ++/Java/Python |
Multiple |
Development difficulty | tedious |
Tedious |
Simple |
Simple |
Relatively cumbersome |
Learning cost |
Low |
Low |
Low |
High |
Applicability |
Data Exchange |
Data Exchange |
Data Exchange |
Data storage and Script Processing |
Note:
For large applications, we recommend that you use xml for data exchange. After all, xml data is structured. This not only allows you to specify a vocabulary that defines the elements in the document, but also allows you to specify the relationship between elements. Of course, json data is also in this format, but in the data storage of large applications, its storage efficiency seems to be insufficient.
But for a small application, if it is a web application, it is a good choice to select json, because you do not need to worry about the annoying methods and attributes when using it, because you operate on json is equivalent to operating an array with an indefinite dimension. How can a language operate on an array? In addition, most languages have begun to encapsulate some good functions and classes for it, therefore, you can easily implement data conversion by calling the database method.
After an SMS system was built, we found that json was originally like this.