0

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 ?

Guapo
  • 3,446
  • 9
  • 36
  • 63

4 Answers4

2

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.

duffymo
  • 305,152
  • 44
  • 369
  • 561
  • what I meant to say is that currently all files together give a total of 100mb. They are readable only data that does not need any changes by the server it self. – Guapo Jan 09 '11 at 14:24
  • That's more reasonable. The in-memory solution is fine; it's the querying that I'd be concerned about if I were you. You might be able to improve on DOM and XPath with an in-memory database if your queries are variable or complex. – duffymo Jan 09 '11 at 14:59
  • they are very straight forward queries with no complications but thanks a lot for your response :) – Guapo Jan 09 '11 at 15:07
1

XML is used as one of the ways of storing data. one of using xml is, it makes the data easy to be readable. you can use mysql if there are lot of users need the access to the data at the same time and mysql also supports transactional processing of data whereas xml does not have such features.

programmer
  • 878
  • 5
  • 8
1

just adding the option in between - you could also use some form of xml database like

eXist (http://exist-db.org/index.html) or sedna (http://modis.ispras.ru/sedna/)

Mads Hansen
  • 63,927
  • 12
  • 112
  • 147
roman
  • 11,143
  • 1
  • 31
  • 42
0

XML stored at local storage, and readable only by local server (don't argue me you can use memcache, replicated via rsync or so)

No doubt you can open the XML via a http server, but it will be slow.

While, mysql support port communication, and replication, it basically don't have boundaries if you expanding to multiple servers.

And even at 5.1, mysql support XML

ajreal
  • 46,720
  • 11
  • 89
  • 119
  • but these files ARE for read-only porpouse which is why I am wondering and the information is sent thru tcp to a client not browsers, nor webserver. – Guapo Jan 09 '11 at 14:27
  • @Guapo - alright, if this only meant for read-only, this question should never exist (hope you get what I mean) – ajreal Jan 09 '11 at 14:28
  • guess it is the other way around :) anyway good lucky with your bad humor hope it changes. – Guapo Jan 09 '11 at 14:31