What the hell is JSON?
JSON is a data format interchange - a way of storing and transferring data. Alongside server-browser communication, it’s common to see uses such as database migration (e.g. converting JSON to SQL) and exporting data from proprietary web apps.
JSON is built on two structures:
- A collection of name/value pairs. In various languages, this is realized as an
keyed list, or
- An ordered list of values. In most languages, this is realized as an
Check out json.org, where the above is taken from, for a breakdown of how JSON works.
Here’s what some JSON data (taken from json.org) look like:
JSON gained such rapid popularity because it makes transferring data so easy. It’s also lightweight and easy-to-read. In fact, JSON is so simple it’s expected that its grammar will never change! Just take a look at how the above JSON data looks in XML (taken from json.org) and you’ll see how ‘heavy’ XML is compared to JSON.
Nowadays, JSON is a standard format all of it’s own: the ECMA-404 The JSON Data Interchange Standard.
How did JSON take over the world?
Unlike many technologies, JSON wasn’t really ‘invented’ by just one person. Many people discovered this data transfer and storage use independently of one another. Even Douglas Crockford, the ex-Atari employee and man who coined and popularized the term ‘JSON’, states he ‘discovered’ JSON rather than ‘invented’ it. In his own words:
But, alongside the rise of AJAX in the early 2000s when people continued to discover and learn about this technique, Crockford was definitely instrumental in the widespread application of JSON we see today. It began in 2002 when he registered the domain name json.org while working at State Software. Using his high-profile status, and subsequent roles at dotcom tech giants such as PayPal, he spread the word about JSON.
Then sometime in 2005, as hardware and software developed, the advent of Single Page Applications and modern mobile/web apps that we know today needed some kind of data interchange to function seamlessly. This caused JSON to explode in popularity.
There was also a sense that XML had been adopted by many big enterprise tech companies, who’d built all sorts of overly complicated tools and technologies on top of XML. But JSON was simple and easy to learn. Json.org literally specifies the whole format with a couple of diagrams!
The web we know today was built by people who believed in keeping things simple and JSON fitted very nicely into that philosophy. Think Google’s homepage vs. Yahoo’s homepage.
The fact that JSON is everywhere today is a good thing. If you need a db converter or database migration, like JSON to SQL, it’s the perfect file format. For example, if you want to export data from a web app, it’s likely you’ll receive it in JSON (although CSV and Excel are still popular). The great thing is every programming language can parse JSON, so it’s truly an open standard that’s interoperable no matter what tech you use.
In a world of APIs, cloud computing, and ever-growing data, JSON has a big role to play in greasing the wheels of a modern, open web.