Comparison of several common structured data

Source: Internet
Author: User

When I first approached Windows Programming, I used the. ini file generally.

Later, they all define the data format and realize the data reading and writing.

Later, it was XML, then I was more accustomed to using TinyXML.

What now? Everyone is using JSON.

In pursuit of performance, many people have turned their eyes to Protobuf and Flatbuffer.

The change in the IT industry is so fast. As an IT practitioner, this piece of information is important.


The antique will not mention, let the archaeologists go deep dig it. This article discusses a good summary of Xml,json and Protobuf,stackoverflow.

Json

. Human readable/editable

. Can is parsed without knowing schema in advance

. Excellent browser support

. Less verbose than XML


Xml

. Human readable/editable

Can is parsed without knowing schema in advance

Standard for SOAP etc-------------?

Good tooling support

Pretty verbose


Protobuf

. Very dense data

. Hard-to-robustly decode without knowing the schema (data format is internally ambiguous, and needs schema to clarify)

. Very fast processing

. Not intended for human eyes (dense binary)

All has good support on the most platforms.

Personally, I rarely use XML these days. If the consumer is a browser or a public API I tend to use JSON. For internal APIs I tend to use protobuf for performance.

The personal view is that:

1. The structure relative to Xml,json is more closely related to "object-oriented" programming. JSON is more concise and conveys the same meaning, with fewer bytes in JSON, less content to transmit, and relatively faster.

2. Why use Protobuf? What are the advantages of relative JSON?

The protobuf is in binary form, with bytes taking up less and faster. Simultaneous PROTOBUF supports multiple programming languages for easy data exchange and version compatibility




Comparison of several common structured data

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.