Are there disadvantages of using XML, instead of RDMS? The reason I ask this is because my data is more naturally represented by XML structure, rather than RDBMS. I initially thought of storing the data in relational database, but the lack of flexibility of relational database to handle tree-like data structure was putting me of. So I am thinking about just storing the data in XML.
使用XML而不是RDMS有缺点吗?我问这个的原因是因为我的数据更自然地由XML结构代表,而不是RDBMS。我最初想过将数据存储在关系数据库中,但是关系数据库缺乏处理树状数据结构的灵活性让我感到兴奋。所以我在考虑将数据存储在XML中。
One thing I fear is performance penalty. While RDBMS can handle large datasets, I am not sure whether the same can be said about XML. Also, the database queries are pretty well-established and fairly easy to use and construct, what about XML queries? I don't know.
我担心的一件事是性能损失。虽然RDBMS可以处理大型数据集,但我不确定是否可以对XML进行相同的说明。此外,数据库查询非常完善,并且相当容易使用和构建,XML查询呢?我不知道。
I am doing .Net application.
我在做.Net应用程序。
In my opinion, these are the factors to consider
在我看来,这些是需要考虑的因素
这更符合您的应用需求
您需要处理多大的数据集?
您是在应用程序之间传输数据还是要查询它?
Once these factors are considered, I would suggest that you decide to use RDBMS, if you have large data processing and querying needs and XML if you need to export data or transfer it between applications. i would also like to suggest that you consider constraints on your data and integrity needs like Nick has suggested.
一旦考虑了这些因素,我建议你决定使用RDBMS,如果你有大量的数据处理和查询需求,那么如果需要导出数据或在应用程序之间传输数据,则需要使用XML。我还建议您考虑像Nick建议的对数据和完整性需求的限制。
I have little experience in the area, however this is what I have heard from others at my school.
我在该地区没有什么经验,但这是我从学校其他人那里听到的。
All the best.
祝一切顺利。
If you are working with XML data, then there is almost no question that you should be looking into a Native XML database.
如果您正在处理XML数据,那么几乎不存在您应该查看Native XML数据库的问题。
Two of the most popular Native XML databases MarkLogic server and eXist both provide extremely robust and efficient indexing mechanisms, as well as many of the features mentioned on this list.
两个最流行的Native XML数据库MarkLogic服务器和eXist都提供了非常强大和高效的索引机制,以及此列表中提到的许多功能。
In fact MarkLogic server for many search applications drastically out performs SQL databases, esp on large xml datasets. This is because its built specifically to work with XML and knows the best way to index it, which without normalizing SQL does not.
事实上,许多搜索应用程序的MarkLogic服务器都会大量执行SQL数据库,尤其是大型xml数据集。这是因为它专门用于处理XML并且知道索引它的最佳方法,而没有规范化SQL则没有。
Based on the current market trend it is apparent that while SQL is not going away, its definently losing market share to NoSQL approaches, especially when document centric data is concerned.
基于当前的市场趋势,很明显,虽然SQL不会消失,但它明确地失去了NoSQL的市场份额,特别是在涉及以文档为中心的数据时。
Further details ----
更多详情 - -
Most, data that humans interact with is unstructured and heigharchal. Normalizing and un normalizing this data into a flat relational structure is not only time consuming from an informational architecture standpoint it also forces us to query the data in a unnatural manner.
大多数人类与之互动的数据都是非结构化和高等级的。将这些数据标准化和非标准化为平坦的关系结构不仅耗费时间,从信息架构的角度来看,它还迫使我们以不自然的方式查询数据。
Current Native xml databases, allow mass amounts of unstrcutured (but schema validated) data to be easily added and efficiently indexed.
当前的本机xml数据库允许轻松添加和有效索引大量未经检查(但模式验证)的数据。
Using xpath to query these documents is a much more natural way of traversing and extracting data, because the queries are representational of the structure.
使用xpath查询这些文档是一种更自然的遍历和提取数据的方法,因为查询是结构的表示。
It's also easily transformed using XQuery and XSLT.
它也可以使用XQuery和XSLT轻松转换。
The end result is a higher ROI for developers. You write less code and get more out. I used to write mainly in php/sql applications. Once we moved our architecture over to Native XML and XQuery I was able to replace thousands of lines of code with much simpler efficient and concise XQuery.
最终结果是开发人员的投资回报率更高。你写的代码越来越少,得到更多。我以前主要在php / sql应用程序中编写。一旦我们将架构转移到Native XML和XQuery,我就能够用更简单有效和简洁的XQuery替换成千上万行代码。
If you have the budget (~250k), check out MarkLogic server. Its is one of the most impressive and scalable database systems ever created and is all Native XML. As far as I know it has support for transactions, rollback etc, and all the other features SQL provides.
如果您有预算(~250k),请查看MarkLogic服务器。它是有史以来最令人印象深刻和可扩展的数据库系统之一,并且都是Native XML。据我所知,它支持事务,回滚等,以及SQL提供的所有其他功能。
eXist (http://exist-db.org) is a open source project that has:
eXist(http://exist-db.org)是一个开源项目,具有:
完整的XQuery / XPath / XSLT支持
有效的索引机制
内置全文搜索功能
支持REST / WebDAV / SOAP / ATOM / XMLRPC
You should not compare XML with an RDBMS, since that are 2 complementary technologies; XML should not be considered, or regarded as a replacement for an RDMBS.
您不应该将XML与RDBMS进行比较,因为这是两种互补技术;不应考虑XML,或将其视为RDMBS的替代品。
An RDMBS is for storing large amounts of data in a consistent way. The RDBMS should take care of the consistentcy of the data, etc ...
RDMBS用于以一致的方式存储大量数据。 RDBMS应该关注数据的一致性等......
XML can be used for data-exchange between different computer systems for instance, but it should not be used to store large amounts of data over a long period of time.
Xml doesn't allow you to take care of data-consistency like an RDMBS does; it doesn't take care of transactions, etc... Xml is actually nothing more then a text-file, that contains data in some kind of structured way.
例如,XML可以用于不同计算机系统之间的数据交换,但不应该用于长时间存储大量数据。 Xml不允许像RDMBS一样处理数据一致性;它不会处理事务等... Xml实际上只不过是一个文本文件,它包含某种结构化方式的数据。
Things an RDBMS provides that XML doesn't, more or less in order of importance:
RDBMS提供的东西,XML不是,或多或少按重要性排序:
执行已定义的模式(尽管这当然可用于XML)
支持多个作家
定义明确的查询语言
通过索引,编译查询等优化访问的能力
触发器,存储过程,计算列等
Plus you don't need to load the entire database into memory before you can access any of it.
此外,您无需在访问任何数据库之前将整个数据库加载到内存中。
XML's an okay serialization format for an object model. It's good for hacking together relatively free-form data models that you can access with XPath, too - especially if you're going to transform that data into XML or HTML via XSLT. And it has the merit of being standard and platform-independent.
XML是对象模型的一个好的序列化格式。将你可以使用XPath访问的相对自由格式的数据模型组合在一起是很好的 - 特别是如果你要通过XSLT将这些数据转换为XML或HTML。它具有标准和平台无关的优点。
But if you get too ambitious with it, you swiftly get into the kind of territory that results in you writing rants about how terrible XML is. (I'm talking to you, Jeff Atwood.)
但是如果你对它过于雄心勃勃,那么你就会迅速进入这种领域,导致你写下关于XML有多糟糕的咆哮。 (我跟你说,杰夫阿特伍德。)
Two big inherent advantages of RDBMS are:
RDBMS的两大固有优势是:
索引。大大提高了性能。
约束。您可以定义元素之间的关系,这有助于维护数据的完整性。
Keep in mind you can put xml in sql server and query it using xpath, so depending on the shape of your data, you may be able to get the best of both worlds.
请记住,您可以将xml放在sql server中并使用xpath进行查询,因此根据数据的形状,您可以充分利用这两个世界。
You can have the best of both worlds, your data can be stored in the database, and that has to be a better solution. As a DB is faster, more secure, has backup and restore, rollback, admin tools and so on ....
您可以充分利用这两个方面,您的数据可以存储在数据库中,这必须是更好的解决方案。由于数据库更快,更安全,具有备份和还原,回滚,管理工具等等....
It sounds as though your data is hierachial in nature, databases can be coerced to store hierarchies without too many issues.
听起来好像您的数据本质上属于层次结构,数据库可以强制存储层次结构而不会出现太多问题。
When it comes to using your data if you extract it as Xml. I know if you're using Sql Server that works out of the box, not so sure for Oracle.
如果您将数据提取为Xml,则需要使用数据。我知道你是否正在使用开箱即用的Sql Server,对Oracle来说并不那么肯定。