Comparison of XML, JSON, protocolbuffer, and Lua features

Source: Internet
Author: User
  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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.