What is the JSON data format and JSON document database?
Chances are you have heard of JSON, but like most people, you may not know what it means. Well, it stands for JavaScript Object Notation. The cool thing about JSON is that it is both human and machine-readable, which many languages lack. Not only that, JSON is an independent language, which is a surprise to many seeing as JavaScript is part of its name. Furthermore, it is not a traditional programming language and more of an open standard data format.
Additionally, this language is a standard API used in a variety of tools and applications, especially on the web. Furthermore, it is one of the significant alternatives to XML.
What is JSON?
JSON is an open standard file & data interchange format that uses human-readable text to store and transmit data objects. It has a diverse range of applications and can serve as a replacement for XML in AJAX systems.
OK, so there are two ways that JSON represents data, and we’re going to discuss them right now for your understanding.
- Array – From our understanding, we define an Array by the left ([) and right (]) brackets. A comma separates every item within the brackets. Furthermore, you can also view this as an ordered collection of values.
- Object – What we have here is a collection of key-value or name-value pairs. Now, when it comes down to defining an object, it must be done within the left ({) and right (}) braces. Every name-value pair inside the braces must begin with the name, followed up by a colon, and finally, the value. A comma must always separate each name-value pair.
What is a JSON Document Database?
There is something called document database when it comes down to JSON, but most folks won’t know of it. However, because we have just explained what JSON is, it only makes sense for us to discuss document databases.
You see, a JSON document database is a form of nonrelational database that was created to store and query data as JSON documents. Instead of normalizing information across several tables, each has a unique and fixed structure similar to a relational database.
One of the impressive things about this is the fact that JSON document databases also use the same document formats used by developers in their application code. This makes it easier for developers to query data whenever they want to.
JSON code examples
JSON String Example:
{ "firstname": "Vamien", "lastname": "McKalin", “occupation”: “Technical Writer” }
JSON Number Example:
{ "id": 1, "age": 56, "bornyear": 1965, "date": 6, "month": 9, "weight" : 99.9 }
Here are some useful online JSON Tools to help you get started.
Enjoy learning JSON, and be sure to hit us up in the comments.