Let’s talk about XML for a minute. It allows you to specify pretty much any data structure you can imagine and validate that data using off-the-shelf tools. If you can create a DTD (Document Type Definition)Â or an XSD (XML Schema) then you can use XML to dramatically improve data interchange processes in any system or application. There is no doubt about it. XML is great at what it does. But…it has a problem.
For certain types of applications, XML has undesirable overhead.Â Overhead in terms of data bloat, parsing and validation. Depending on the nature of your data, XML can double or triple the size of your data. Yes, this is STILL a problem even in the exciting new broadband world we live in. You still want to get your data from point A to point B as fast as possible and XML can slow things down quite a bit. Also, the overhead of parsing XML is substantial. Again, in a world where the smallest desktop computer can easily outperform the supercomputers of 20-30 years ago, this may not seem like a huge problem. But it is…
After the full impact of this sunk in, I realized that the acronym was wrong. AJAX should actually be AJAJ. Or AJAJSON…ok, lets just leave it AJAX. The following article is a fantastic read for understanding the point that i’m trying to make.
XML definitely rules most areas of data exchange but the point is that JSON is definitely the way to go for AJAX applications.