views:

184

answers:

5

I am interested in XML. I know it from Google's CSE.

It is often a pain for me to manipulate 3000-rows XML files. This raises a question.

Why does Google use XML, not MySQL, such that I need to manipulate large XML -files?

+4  A: 

XML is mostly human readable and cross platform. How would google send you data from just MYSql? Would you expect them to send you a binary blob that assumes you have the proper database to insert it into? How would you use that blob if MYSql wasn't installed, or a different version of MYSql was installed on your machine than on google?

Jared
+2  A: 

XML is often uses as a transport format between systems. In CSE I would guess that google is transferring a lot of data from them to you in a format that many systems can use. If they used MySQL it would be no use to me as I don't know anything about it. However, pretty much most modern software frameworks can work with XML.

ADDITIONAL

Also, CSE (Customised Search Engine) probably expects that you don't need to do a lot of manipulation to the XML, just transform if for rendering to a web page. You can very easily perform an XSLT (Extensible Stylesheet Language Transformation) to an XML file to transform it in to an HTML fragment to use on your website.

Colin Mackay
+1  A: 

MySQL is a specific SQL database engine. One not very suitable for providing the backend for the very very large dataset and special special needs that a search engine like google have. I'm sure you can dig up info on how google's infrastructore, e.g. starting here

Relying on and exposing something specific like MySQL is not something you want to do when exchanging data over the internet.

XML on the other hand, being a general and textual markup language is ideal when you need to interface and exchange data between systems. Thus it provides an ideal way to interface services such as Google CSE. You don't need to care about the specific implementation google have to provide the data, and Google don't need to care about the specific technology you use to manipulate the data

nos
+8  A: 

XML has at least these advantages over SQL for data interchange purposes:

  • It's self-describing, you don't need to have any additional information to parse it.
  • It's a true standard, universally interoperable.
  • You aren't limited to tabular-oriented data: you can also use it to model hierarchies, for instance.

Probably the best you can do with SQL is ship tables in source code form, ie, as CREATE TABLE statements followed by a lot of INSERT statements. This is fine if you have a compatible database, but since SQL never really crystallized as a standard, interoperability at this level is very poor, and Google would have to offer multiple dialects (perhaps even for incompatible versions of the same DBMS).

Jim Ferrans
+1 Excellent, concise answer!
vg1890
+1  A: 

In addition to @Jared, there are XML databases. If the data is stored in XML, then it can be queried, transformed into html on the fly, or used in applications without the need for wrapping the data.

WolfmanDragon