是在MySQL上受益还是使用XML,反之亦然? [英] Benefits or using XML over MySQL and vice-versa?

查看:124
本文介绍了是在MySQL上受益还是使用XML,反之亦然?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在从事的项目不是我自己做的,但是它使用了很多XML文件而不是MySQL来代替它.

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.

因此,我想知道在这里使用XML取代MySQL真的有什么好处.

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

场景是,XML文件仅加载一次,并在服务器上用于它所做的N件事. 仅当管理员向服务器发出命令以重新加载XML时,才重新加载XML. 所有XML文件加起来最大平均大小为100 mb.

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.

如果您能对上述内容进行一些简短的介绍,将对MySQL上XML的使用表示感谢.

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

与简单的innodb或myisam表相比,什么时候XML是更好的选择,我应该考虑些什么?

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

推荐答案

如果您的数据是只读的,并且仅在管理员的命令下才带入内存,那么我认为这两种技术都没有太大的优势

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将具有SQL查询的优势.即使在这种情况下,重要的还是数据类型.如果您有较长的参考链/对象图,那么由于所有JOIN的关系数据库可能会变慢.

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.

但是XML有其自身的问题.您可以轻松地将其解析为DOM对象,但随后只有XPath可以搜索它.

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

这篇关于是在MySQL上受益还是使用XML,反之亦然?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆