JSON versus XML

Both JSON and XML are simple, open, and interoperable. Since JSON usually contains less data, by using JSON, less data traverses through the network. Both formats are human-readable; JSON is a bit cleaner, since it contains less text. This is because the number of data formats supported by JSON is much smaller than with XML.

JSON is handy for sharing data. Data in JSON is stored in arrays and objects while XML documents form a tree structure. Therefore, data transfer is easier with JSON and native for many programming languages: JavaScript, Python, Perl, Ruby, and so on. On the other hand, XML can store more data types (JSON does not have even a data type for date); it can include photos, videos, and other binary files. XML ...

Get SQL Server 2017 Developer's Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.