Database Reference
In-Depth Information
JSON also shares some of the less desirable characteristics of XML: It is certainly
a verbose format, and it will take up additional storage space and bandwidth. Like
XML, each field in a JSON record has some description involved, resulting in quite a
lot of markup for the amount of data described. Although it is a good format for pass-
ing messages from one place to another, JSON is not designed for extensibility, and it
lacks some of the fancy schema and validation features found in XML.
Finally, there's another excellent reason to consider hosting data in JSON: It is often
trivial to import JSON objects into many types of popular, open-source, nonrelational
databases. We will take a look at some of this technology in Chapter 3, “Building a
NoSQL-Based Web App to Collect Crowd-Sourced Data.”
Hosting a collection of data in newline-delimited JSON format is a good start for
data exchange when coders are involved, and this format will make application devel-
opers and nonrelational database administrators happy. JSON is not a great format for
a general population that expects to be able to load files directly into a spreadsheet (for
that application, use CSV).
Listing 1.2 provides a brief comparison of the structure of CSV, XML, and JSON
formats.
Listing 1.2 Comparison of CSV, XML, and JSON
# CSV example
first_name,last_name,book,date
"Michael", "Manoochehri", "Data Just Right",2013
<!-- XML Example -->
<xml>
<author>Michael Manoochehri</author>
<list>
<book position="1">Data Just Right</book>
</list>
</xml>
// JSON example
{
"name": "Michael",
"book":{"title":"Data Just Right","date":"2013"}
}
Character Encoding
Character encoding is the process by which a computer represents all the characters
and symbols necessary for exchanging information, such as the ones you are reading
right now. A very simple example of character encoding is Morse code, which repre-
sents letters in the alphabet as pulses that can be transmitted over a wire or visually.
 
 
 
Search WWH ::




Custom Search