JSON or XML for the standard

Today I tasked myself with an important first step for creating what is now called the ‘scred’ file. Though I have PHP skills, I’m for sure not a diehard in programming. Yet I want to define a standard that programmers will love too. So here’s the why behind the tech bit of the SiteCredits system.

Why XML would be great

When a webdesigner, or developer starts it’s journey, it will come across HTML pretty fast. I remember my first HTML adventures in the early 90’s. Yes, Netscape was still a thing as well as a local search engine called Ilse.nl.

HTML is pretty easy to understand. It’s pretty well structured. Even today, it’s easy to draft up an HTML document.

In the late 90’s, HTML didn’t only evolve in versions and features, we got heaps of variants hitting the web. Most of them all evolved around what was known as XML, which even resulted in the XHTML standard.

Today, XML is still used a lot and loved for it’s readability. For example in the sitemap XML files that are widely used by the likes of Google, Yandex, Baidu and Bing. Rumors suggest even Apple might launch it’s own search later this year and will probably rely on sitemaps as well.

Why we did pick JSON

When looking at Google Trends reports, we see XML is declining in interest over JSON. Google even chose it for indexing micro formats, given that JSON data is present in the DOM of a webpage.

Compared to XML, JSON files are less readable to humans. For computers that’s a whole other ball game. JSON files are extremely light. So the data transfer happens much faster and the JSON data is much more easy to process.

Now there’s one thing we don’t want. We don’t want SiteCredits to be part of the DOM. For optimal website performance, the DOM should be as lightweight as possible. In other words, we do not want the browser to fetch anything it doesn’t need for the average user. Even if it’s very lightweight.

Does that matter when it’s about a file that probably will be accessed only a few times a year? Yes, for us matters a lot. We expect a lot of users will use our site for reading the scred files on websites. That means we will potentially be processing a whole lot of data in the years to come. JSON means we will pay for less datatraffic and will consume less memory and CPU on our servers.

So picking JSON as the file format is the most logical thing to do. Now it’s time to start thinking about how to creaft the JSON standard to be future proof.

chevron_left