Well, I understand its a little stupid. If I wish to store a lot of data. Must I use xml or database(mysql)?

So why do you select (that) one?

Do you know the benefits and drawbacks using xml?

Do you know the benefits and drawbacks using mysql?

Clubpenguin, habbo hotel, individuals virtual mobile phone industry's are utilizing xml or mysql??

MySQL (or SQL Server, Oracle, DB2, etc.) are database engines: they are specific programs thatwere designed for data storage and processing, and therefore are excellent at doing that they can also operate on another server compared to one where your primary program is, permitting for load discussing.

XML files are simply text files saved in your machine or any other one they should be read, parsed and written to, and just your program can perform that. They'are also really, really inefficient, due to their text character: reading through and parsing a text file is extremely slow, and modifying it's a whole lot worse.

XML files are great for storing configuration configurations and passing data between different systems, but data storage and processing should certainly reside in an effective DBMS.

Consider for those who have an XML document having a nested person element that consists of info on all of your customers, and you've got 3000 customers. If you wish to pull the data for an individual, you are likely to have quite the job of parsing using that huge file to locate that person's information. You may can use some clever trying to jump round the file, but ultimately there's likely to be a lot of consecutive access.

Having a database you'll ordinarily have indexes, which may permit you to very rapidly perform searching tasks such as the above. Within the above scenario, finding a person within an indexed table will most likely be around the order of 100 occasions faster.

It is dependent a great deal on which type of data you need to store. If you're storing mostly document oriented stuff, XML could be a sensible choice. If you're storing plenty of small hierarchies, XML is most likely much better than SQL. Time to see and parse an XML file is certainly more the time required to obtain a simple query from a database. But when you've data that don't fit naturally inside a database, the price of query may go up significantly and really become not only using XML files.

Another option you could attempt is applying an XML database, for instance Xindice (http://xml.apache.org/xindice/). XML databases aren't much used right now, mostly because we do not have good mathematical ideas about hierachic databases. But they may be really helpfull if you possess the right problem ...

This appears much more of a StackOverflow question as opposed to a ServerFault question. Anyways..

If you want random use of data elements, make use of a real database. If you are just doing batch processing or something like that, xml works, but a database continues to be fine for your too.

If you don't have to store data with relational qualities, why not consider a key/value store, or document-oriented database, rather than a RDBMS, for better performance/scalability in return for less features.

Well, I understand its a little stupid. If I wish to store a lot of data. Must I use xml or database(mysql)?

To begin with, XML is hierarchic by its character, while MySQL is relational.

For a moment store your computer data as XML document:


, it's quite simple to acquire all addresses of the customer, although not very easy to acquire clients for any given address.

Second, XML is much more user-oriented. It is simple to edit it together with your favourite text editor. In MySQL, it isn't very easy.

Given all above, in case your data are hierarchical, small in dimensions and also you need these to easily be editable with no frontend, use XML.

In case your data are relational and also you need fast set procedures on large amounts of information, use MySQL.