热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

与RDMS相比,XML的优点/缺点-TheAdvantages/DisadvantagesofXMLcomparedtoRDMS

AretheredisadvantagesofusingXML,insteadofRDMS?ThereasonIaskthisisbecausemydataism

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应用程序。

6 个解决方案

#1


In my opinion, these are the factors to consider

在我看来,这些是需要考虑的因素

  1. Which fits your applications needs more closely
  2. 这更符合您的应用需求

  3. How large a data set you need to handle?
  4. 您需要处理多大的数据集?

  5. Are you transferring data between applications or are you going to query it?
  6. 您是在应用程序之间传输数据还是要查询它?


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.

祝一切顺利。

#2


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)是一个开源项目,具有:

  • full XQuery/XPath/XSLT support
  • 完整的XQuery / XPath / XSLT支持

  • efficient indexing mechanisms
  • 有效的索引机制

  • Built in full text search
  • 内置全文搜索功能

  • Support for REST/WebDAV/SOAP/ATOM/XMLRPC
  • 支持REST / WebDAV / SOAP / ATOM / XMLRPC

  • Versioning

#3


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实际上只不过是一个文本文件,它包含某种结构化方式的数据。

#4


Things an RDBMS provides that XML doesn't, more or less in order of importance:

RDBMS提供的东西,XML不是,或多或少按重要性排序:

  • enforcement of a defined schema (though this is certainly available to XML)
  • 执行已定义的模式(尽管这当然可用于XML)

  • support for multiple writers
  • 支持多个作家

  • atomic transactions
  • referential integrity
  • well-defined query language
  • 定义明确的查询语言

  • ability to optimize access through indexes, compiled queries, etc.
  • 通过索引,编译查询等优化访问的能力

  • role-based security
  • triggers, stored procedures, calculated columns, etc.
  • 触发器,存储过程,计算列等

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有多糟糕的咆哮。 (我跟你说,杰夫阿特伍德。)

#5


Two big inherent advantages of RDBMS are:

RDBMS的两大固有优势是:

  1. Indexing. Greatly enhances performance.
  2. 索引。大大提高了性能。

  3. Constraining. You can define relationships between elements which helps maintain the integrity of your data.
  4. 约束。您可以定义元素之间的关系,这有助于维护数据的完整性。

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进行查询,因此根据数据的形状,您可以充分利用这两个世界。

#6


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来说并不那么肯定。


推荐阅读
  • MyBatis多表查询与动态SQL使用
    本文介绍了MyBatis多表查询与动态SQL的使用方法,包括一对一查询和一对多查询。同时还介绍了动态SQL的使用,包括if标签、trim标签、where标签、set标签和foreach标签的用法。文章还提供了相关的配置信息和示例代码。 ... [详细]
  • Python正则表达式学习记录及常用方法
    本文记录了学习Python正则表达式的过程,介绍了re模块的常用方法re.search,并解释了rawstring的作用。正则表达式是一种方便检查字符串匹配模式的工具,通过本文的学习可以掌握Python中使用正则表达式的基本方法。 ... [详细]
  • Linux重启网络命令实例及关机和重启示例教程
    本文介绍了Linux系统中重启网络命令的实例,以及使用不同方式关机和重启系统的示例教程。包括使用图形界面和控制台访问系统的方法,以及使用shutdown命令进行系统关机和重启的句法和用法。 ... [详细]
  • flowable工作流 流程变量_信也科技工作流平台的技术实践
    1背景随着公司业务发展及内部业务流程诉求的增长,目前信息化系统不能够很好满足期望,主要体现如下:目前OA流程引擎无法满足企业特定业务流程需求,且移动端体 ... [详细]
  • 本文讨论了clone的fork与pthread_create创建线程的不同之处。进程是一个指令执行流及其执行环境,其执行环境是一个系统资源的集合。在调用系统调用fork创建一个进程时,子进程只是完全复制父进程的资源,这样得到的子进程独立于父进程,具有良好的并发性。但是二者之间的通讯需要通过专门的通讯机制,另外通过fork创建子进程系统开销很大。因此,在某些情况下,使用clone或pthread_create创建线程可能更加高效。 ... [详细]
  • 深入理解Kafka服务端请求队列中请求的处理
    本文深入分析了Kafka服务端请求队列中请求的处理过程,详细介绍了请求的封装和放入请求队列的过程,以及处理请求的线程池的创建和容量设置。通过场景分析、图示说明和源码分析,帮助读者更好地理解Kafka服务端的工作原理。 ... [详细]
  • 本文介绍了一种轻巧方便的工具——集算器,通过使用集算器可以将文本日志变成结构化数据,然后可以使用SQL式查询。集算器利用集算语言的优点,将日志内容结构化为数据表结构,SPL支持直接对结构化的文件进行SQL查询,不再需要安装配置第三方数据库软件。本文还详细介绍了具体的实施过程。 ... [详细]
  • PeopleSoft安装镜像版本及导入语言包的方法
    本文介绍了PeopleSoft安装镜像的两个版本,分别是VirtualBox虚拟机版本和NativeOS版本,并详细说明了导入语言包的方法。对于Windows版本,可以通过psdmt.exe登录进入,并使用datamover脚本导入语言包。对于Linux版本,同样可以使用命令行方式执行datamover脚本导入语言包。导入语言包后,可以实现多种语言的登录。参考文献提供了相关链接以供深入了解。 ... [详细]
  • Question该提问来源于开源项目:react-native-device-info/react-native-device-info ... [详细]
  • 本文讨论了如何优化解决hdu 1003 java题目的动态规划方法,通过分析加法规则和最大和的性质,提出了一种优化的思路。具体方法是,当从1加到n为负时,即sum(1,n)sum(n,s),可以继续加法计算。同时,还考虑了两种特殊情况:都是负数的情况和有0的情况。最后,通过使用Scanner类来获取输入数据。 ... [详细]
  • Spring特性实现接口多类的动态调用详解
    本文详细介绍了如何使用Spring特性实现接口多类的动态调用。通过对Spring IoC容器的基础类BeanFactory和ApplicationContext的介绍,以及getBeansOfType方法的应用,解决了在实际工作中遇到的接口及多个实现类的问题。同时,文章还提到了SPI使用的不便之处,并介绍了借助ApplicationContext实现需求的方法。阅读本文,你将了解到Spring特性的实现原理和实际应用方式。 ... [详细]
  • 本文详细介绍了Linux中进程控制块PCBtask_struct结构体的结构和作用,包括进程状态、进程号、待处理信号、进程地址空间、调度标志、锁深度、基本时间片、调度策略以及内存管理信息等方面的内容。阅读本文可以更加深入地了解Linux进程管理的原理和机制。 ... [详细]
  • 关于我们EMQ是一家全球领先的开源物联网基础设施软件供应商,服务新产业周期的IoT&5G、边缘计算与云计算市场,交付全球领先的开源物联网消息服务器和流处理数据 ... [详细]
  • 怀疑是每次都在新建文件,具体代码如下 ... [详细]
  • 本文详细介绍了Android中的坐标系以及与View相关的方法。首先介绍了Android坐标系和视图坐标系的概念,并通过图示进行了解释。接着提到了View的大小可以超过手机屏幕,并且只有在手机屏幕内才能看到。最后,作者表示将在后续文章中继续探讨与View相关的内容。 ... [详细]
author-avatar
45度向上倾斜的世界取_872
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有