java – XML vs JSON. Which is better for storing small pieces of data?

See English answers > What are the pros and cons of XML and JSON? [closed] 17

1. Which is better? XML or JSON for storing data?

2. What are the advantages and disadvantages of JSON and XML?

Any help would be appreciated

edit

We don't use any web services. Our application is a stand - alone application We want to use XML or JSON to store some local data that will be used in the application Data is like the details of questions and answers, static user details, etc

Solution

Remember, if the tag is longer than the data, JSON will only be smaller

XML professionals

>Easier to read > much more than JSON > one of the major industry standards > versioning > namespace support > multiple elements with the same name > validation

XML disadvantages

>Take up more space > increase bandwidth due to size

JSON professionals

>Don't take up a lot of space > use less bandwidth due to size (floor area) > rise in the ranks as one of the main industry standards

JSON disadvantages

>Harder to read > versioning destroys client / data

If you send more data than tags, they are roughly the same, and you can better use XML for fast parsing I also think people expect slower mobile loading time and shorter application running time, so please try to parse in a slower format to slow down the application time

Finally, I say JSON, a small footprint will accelerate the transaction between your application and the web service you are trying to send / receive data

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>