Search code examples
javamysqlxmldatabase-management

Benefits or using XML over MySQL and vice-versa?


I am currently working on a project that was not made by me but it makes use of a lot XML files instead of MySQL in place of it.

Because of that it makes me wonder if there is really any benefits of using XML over MySQL here.

The scene is, the XML files are loaded only ONCE and used on the server for N things it does. The XML is only reload if the admin issue a command to the server to reload it. All the XML files together have an average of maximum 100 mb size.

If you could as well give me a little brief of the above in regards the usage of XML over MySQL would appreciate.

What should I consider to know when a XML would be a better option over a simple innodb or myisam table ?


Solution

  • If your data is read-only and brought into memory only at the command of the admin, then I don't think it's much of an advantage for either technology.

    MySQL would have the advantage of SQL queries if you have to search the data. Even in that case it's the type of data that matters. If you have long reference chains/object graphs, then a relational database may be slow because of all the JOINs.

    But XML has its own issues. You can easily parse it into a DOM object, but then you only have XPath to search it.