Friday, November 18, 2011

JSON vs XML

          Both XML and JSON are competing formats for storage and interchange of data in a machine, language, platform independent way. JSON boasts simplicity as its main advantage over XML. Even though XML is the more established technology, it is being replaced by JSON as the preferred solution in many areas. it's popularity is only growing as more and more developers are choosing JSON over XML as their preferred solution for rpc and data interchange in general. Though JSON had its humble beginning as a simple way of data exchange in java script, currently it's available in all major programming languages and technologies. For any one who would like to learn more about JSON www.json.org would be a good starting point.
         But there is another side to this story. Internet is full of discussions and arguments, where supporters of both have been trying to establish their technical superiority over the other. You can find many blog posts where someone proves one is better than the other. The choice of one over the other is not so straight forward, and it gets complicated due to the fact that the performance of these technologies for any specific purpose depends on the nature of the data as well. So making a decision based on these blog posts might not be good idea.
         So at work, when we had to decide between json and xml for rpc, we did a thorough evaluation of both options in terms of data transfer efficiency and processing efficiency. Json showed clear advantages over xml for our purpose, and we decided to go with JSON. I can't disclose any specifics of the tests, but it should be very easy for any one to do some tests before deciding JSON or XML as the solution for their problem.

No comments:

Post a Comment