Document-oriented database(文档数据库)

article/2025/11/5 23:56:41

前言:

关系型数据库已经红火了很久,但是其弊端也是显而易见的,对于很多非结构数据以及半结构化数据很难有效地管理,而且RDBMS的固定式的Schema往往很难接受,太呆板不灵活,因此基于可自由伸缩的schema的数据库随之而来了,这个就是文档数据库,伴随着云计算技术的发展,支持MapReduce以及多点复制、反向搜索引擎技术的文档数据库正在渐渐地成为了主流,其中的开源娇娇者有 Hadoop,  CouchDB, MongoDB等众多的数据库,不过各个数据都有自己的特点。

 

Wikipedia论述:

A document-oriented database is a computer program designed for document-oriented applications. These systems may be implemented as a layer above arelational database or an object database.

For example here's a document:

FirstName="Bob", Address="5 Oak St.", Hobby="sailing".

Another document could be:

FirstName="Jonathan", Address="15 Wanamassa Point Road", Children=[{Name:"Michael",Age:10}, {Name:"Jennifer", Age:8}, {Name:"Samantha", Age:5}, {Name:"Elena", Age:2}].

Notice that both documents have some similar information and some different - but unlike a relational database where each record would have the same set of fields and unused fields might be kept empty, there are no empty 'fields' in either document (record) in this case. This system allows new information to be added and it doesn't require explicitly stating if other pieces of information are left out, as in relational databases.

It is noteworthy here that using XML, YAML or JSON for information storage has advantages similar to document oriented database. In these languages each record can have a non-standard amount of information. Such information is properly calledsemi structured data.

Another advantage of document oriented databases is the ease of usage and programming so that untrained business users, for example, can create applications and design their own databases. Information can be added without worrying about the "record size" and so programmers simply need to build an interface to allow the information to be entered easily.

Contents

[hide]
  • 1Implementations
    • 1.1XML database implementations
  • 2Rationale for XML in databases
  • 3Native XML databases
  • 4XML Databases with database APIs (XQJ, XML:DB, RESTful)
  • 5 References
  • 6External references
  • 7See also
  • 8References
  • 9Further reading
  • 10External links

Implementations

Name↓Publisher↓License↓Language↓Notes↓RESTful API↓
Lotus NotesIBMProprietary  (unknown)
askSamaskSam SystemsProprietary  (unknown)
ApstrataApstrataProprietary  (unknown)
DatawaspSignificant Data SystemsProprietary  (unknown)
CRXDay SoftwareProprietary  (unknown)
MUMPS Database[1] Proprietary and GNU Affero GPL[2]MUMPSCommonly used in health applications.(unknown)
UniVerseRocket SoftwareProprietary  Yes (Beta)
UniDataRocket SoftwareProprietary  Yes (Beta)
JackrabbitApacheApache LicenseJava (unknown)
CouchDBApacheApache LicenseErlangJSON over HTTPYes
FleetDBFleetDBMIT LicenseClojureA JSON-based schema-free database optimized for agile development.(unknown)
MongoDB GNU AGPL v3.0[3]C++Fast, document-oriented database optimized for highly transient data.(unknown)
GemFire Enterprise[2]VMWareCommercialJava, .NET, C++Memory-oriented, fast, key-value database with indexing and querying support.Yes
OrientDBOrientDBApache LicenseJavaJSON over HTTPYes
RavenDBRavenDBcommercial or GNU AGPL v3.0.NETA .NET LINQ-enabled Document Database, focused on providing high performance, transactional, schema-less, flexible and scalable NoSQL data store for the .NET and Windows platforms.Yes
Redis BSD LicenseANSI CKey-value store supporting lists and sets with fast, simple and binary-safe protocol.(unknown)
StrokeDB[3]MIT License Alpha software.(unknown)
Terrastore Apache LicenseJavaJSON/HTTP(unknown)
ThruDB BSD LicenseC++, JavaBuilt on top of Apache Thrift framework that provides indexing and document storage services for building and scaling websites. Alternate implementation is being developed in Java.Alpha software.(unknown)
PerseverePersevereBSD License A JSON database and JavaScript Application Server. Provides RESTful JSON interface for Create, read, update, and delete access to data. Also supports JSONQuery/JSONPath querying.Yes
DBSlayerDBSlayerApache LicenseCdatabase abstraction layer (overMySQL) used by the New York Times. JSON over HTTP.(unknown)
Eloquera DBEloqueraProprietary.NETHigh performance. Based on Dynamic objects. Supports LINQ, SQL queries.(unknown)


XML database implementations

All XML databases are document-oriented databases.

An XML database is a data persistence software system that allows data to be stored in XML format. This data can then be queried, exported and serialized into the desired format.

Two major classes of XML database exist:

  1. XML-enabled: these map all XML to a traditional database (such as arelational database[4]), accepting XML as input and rendering XML as output. This term implies that the database does the conversion itself (as opposed to relying on middleware).
  2. Native XML (NXD): the internal model of such databases depends on XML and uses XML documents as the fundamental unit of storage, which are, however, not necessarily stored in the form of text files.

Rationale for XML in databases

O'Connell (2005, 9.2) gives one reason for the use of XML in databases: the increasingly common use of XML fordata transport, which has meant that "data is extracted from databases and put into XML documents and vice-versa". It may prove more efficient (in terms of conversion costs) and easier to store the data in XML format.

Native XML databases

The term "native XML database" (NXD) can lead to confusion. Many NXDs do not function as standalone databases at all, and do not really store the native (text) form.

The formal definition from the XML:DB initiative (which appears to be inactive since 2003[5]) states that a native XML database:

  • Defines a (logical) model for an XML document — as opposed to the data in that document — and stores and retrieves documents according to that model. At a minimum, the model must include elements, attributes,PCDATA, and document order. Examples of such models include theXPath data model, the XML Infoset, and the models implied by the DOM and the events in SAX 1.0.
  • Has an XML document as its fundamental unit of (logical) storage, just as arelational database has a row in a table as its fundamental unit of (logical) storage.
  • Need not have any particular underlying physical storage model. For example, NXDs can use relational,hierarchical, or object-oriented database structures, or use a proprietary storage format (such as indexed, compressed files).

Additionally, many XML databases provide a logical model of grouping documents, called "collections". Databases can set up and manage many collections at one time. In some implementations, a hierarchy of collections can exist, much in the same way that an operating system's directory-structure works.

All XML databases now[update] support at least one form of querying syntax. Minimally, just about all of them support XPath for performing queries against documents or collections of documents. XPath provides a simple pathing system that allows users to identify nodes that match a particular set of criteria.

In addition to XPath, many XML databases support XSLT as a method of transforming documents or query-results retrieved from the database. XSLT provides adeclarative language written using an XML grammar. It aims to define a set of XPathfilters that can transform documents (in part or in whole) into other formats includingPlain text, XML, or HTML.

Many XML databases also support XQuery to perform querying. XQuery includes XPath as a node-selection method, but extends XPath to provide transformational capabilities. Users sometimes refer to its syntax as "FLWOR" (pronounced 'Flower') because the query may include the following clauses: 'for', 'let', 'where', 'order by' and 'return'. Traditional RDBMS vendors (who traditionally had SQL only engines), are now shipping with hybrid SQL and XQuery engines. Hybrid SQL/XQuery engines help to query XML data alongside the relational data, in the same query expression. This approach helps in combining relational and XML data.

Some XML databases support an API called the XML:DB API (or XAPI) as a form of implementation-independent access to the XMLdatastore. In XML databases, XAPI resemblesODBC and JDBC as used with relational databases. On the 24th of June 2009, The Java Community Process released the final version of the XQuery API for Java specification (XQJ) - "a common API that allows an application to submit queries conforming to the W3C XQuery 1.0 specification and to process the results of such queries".

XML Databases with database APIs (XQJ, XML:DB, RESTful)

XML Database↓License↓Language↓XQJ API↓XML:DB API↓RESTful API↓
BaseXBSD LicenseJava Yes Yes Yes
xDBCommercialJava Yes No No
eXistLGPL LicenseJava Yes Yes Yes
MarkLogic ServerCommercialC++ Yes No Yes
MonetDB/XQueryProprietaryC++ No Yes No
OracleCommercialC++ Yes No No
SednaApache LicenseC++ Yes Yes No

References

  1. ^ Extreme Database programming with MUMPS Globals
  2. ^ GTM MUMPS FOSS on SourceForge
  3. ^ [1]
  4. ^ Mustafa Atay and Shiyong Lu, “Storing and Querying XML: An Efficient Approach Using Relational Databases”,ISBN 3-639-11581-3, VDM Verlag, 2009.
  5. ^ http://xmldb-org.sourceforge.net/faqs.html

External references

  • XML Databases - The Business Case, Charles Foster, June 2008 - Talks about the current state of Databases and data persistence, how the current Relational Database model is starting to crack at the seams and gives an insight into a strong alternative for today's requirements.
  • An XML-based Database of Molecular Pathways (2005-06-02) Speed / Performance comparisons of eXist, X-Hive, Sedna and Qizx/open
  • XML Native Database Systems: Review of Sedna, Ozone, NeoCoreXMS 2006
  • XML Data Stores: Emerging Practices
  • Bhargava, P.; Rajamani, H.; Thaker, S.; Agarwal, A. (2005) XML Enabled Relational Databases, Texas, The University of Texas at Austin.
  • O'Connell, S. Advanced Databases Course Notes, Southampton, University of Southampton, 2005
  • Initiative for XML Databases
  • XML and Databases, Ronald Bourret, September 2005
  • XML Database Products, Ronald Bourret, 2000–2009
  • The State of Native XML Databases, Elliotte Rusty Harold, August 13, 2007

http://chatgpt.dhexx.cn/article/IyNjr3nO.shtml

相关文章

数据库需求文档

数据库管理文档 记录人:娄雨禛 转载于:https://www.cnblogs.com/DeltaFish/p/9134329.html

关系型数据库 和 文档类型数据库 的区别

如果在使用的时候,需要频繁的去查复杂的表与表之间的关联关系时,关系型数据库更友好。 如果在使用的时候,需要频繁对数据进行读写操作时,文档类型数据库更友好。 数据类型: String:字符串      Numbe…

华为云文档数据库服务更安全

华为云文档数据库服务更安全 华为云文档数据库服务(Document Database Service)作为华为云数据库的一款明星产品,它在数据库兼容方面完全兼容了MongoDB协议,能够为我们提供安全、高可用、高可靠、弹性伸缩和易用的数据库服务&am…

开源的文档型数据库--MongoDB(安装)

1、简介 MongoDB 是一个开源的、文档数据库管理系统。它提供了高性能、高可扩展性和高可用性。 MongoDB 使用了一种称为 BSON 的二进制形式的 JSON 来存储数据。这使得 MongoDB 可以轻松地存储各种数据类型,包括大型对象和二进制文件。 MongoDB 的一个重要特性是它的…

数据库文件

数据库由 存储在 硬件设备上的信息组成。 而 mysql 、sqlist 等只是数据库系统, 在 数据库 使用者 和 储存在 硬件上面的 数据 之间建立联系的桥梁。 最终, 我们存储在数据库里面的信息会以 文件(或内存)的形式展示在操作系统上。 如 Ubuntu16.04 &a…

文档数据库-MongoDB

文章目录 前言优点MongoDB 使用广泛MongoDB 性能高MongoDB 支持分布式安装和部署容易MongoDB 便于开发 MongoDB的文档数据模型NoSQL 中的文档数据库MongoDB 文档数据模型 MongoDB的文档存储结构键值对文档集合数据库 前言 MongoDB 是一个开源文档数据库,提供高性能…

MongoDB文档数据库

一,引言 MongoDB 是一个开源的文档数据库,并是领先的NoSQL数据库。 MongoDB 是由C语言编写。 通过本系列教程的讲解,使得学习者可以了解并掌握创建和部署高度可扩展和高性能的面向对象数据库MongoDB概念和理解。 该系列教程是专为软件专业人员…

NOSQL,MongoDB是什么?

什么是MongoDB ? MongoDB 是一个开源的文档数据库,它基于 C 语言编写,性能高,可用性强,能够自动扩展。 MongoDB 是最流行的 NoSQL 数据库之一,原生支持分布式集群架构,特别适合处理大数据&…

胖人瘦下来后,会长高或变矮吗?

一个还算高的胖子,单看是不显矮的,但正所谓没有对比就没有伤害,若将他与一个跟他一般高的瘦人排在一起,就会无端显得矮了一截,当然也只是“显得”矮而已,并非真的矮。 那么,他们要是瘦下来后会…

PTA 7-40 到底是不是太胖了

很明显题目中有绝对值&#xff0c;需要调用绝对值函数。 整形绝对值&#xff1a;abs函数 双精度浮点型绝对值&#xff1a;fabs函数 长整型绝对值&#xff1a;labs函数 他们的头文件都是include<math.h>或者include<stdlib.h> 接着一个for循环就可以解决问题。…

PTA题目 到底是不是太胖了

据说一个人的标准体重应该是其身高&#xff08;单位&#xff1a;厘米&#xff09;减去100、再乘以0.9所得到的公斤数。真实体重与标准体重误差在10%以内都是完美身材&#xff08;即 | 真实体重 − 标准体重 | < 标准体重10%&#xff09;。已知市斤是公斤的两倍。现给定一群人…

[模板]详细设计说明书(整理版)【申明:来源于网络】

[模板]详细设计说明书&#xff08;整理版&#xff09;【申明&#xff1a;来源于网络】 地址&#xff1a;http://www.doc88.com/p-0724366501067.html

模板设计模式

模板设计模式—基于抽象类的&#xff0c;核心是封装算法 模板方法定义了一个算法的步骤&#xff0c;并允许子类为一个或多个步骤提供具体实现模板&#xff08;模板方法&#xff09;模式&#xff08;Servlet、AQS&#xff09; 在一个方法中定义一个算法的骨架&#xff0c;并将一…

资深码农教你写详细设计(附示例模板)

很多小伙伴都不知道怎么写详细设计&#xff0c;本期就带大家看一下详细设计都有哪些内容。 喜欢听我叨叨的&#xff0c;直接看视频 资深码农教你写详细设计&#xff08;附模板&#xff09; 不同的公司&#xff0c;详细设计不太一样&#xff0c;有的细&#xff0c;有的粗&#x…

【零基础深度学习教程第二课:深度学习进阶之神经网络的训练】

深度学习进阶之神经网络的训练 神经网络训练优化一、数据集1.1 数据集分类1.2 数据集的划分1.3 同源数据集的重要性1.4 无测试集的情况 二、偏差与方差2.1 概念定义2.1.1 偏差&#xff08;bias&#xff09;2.1.2 方差&#xff08;variance&#xff09; 2.2 图形定义2.3 衡量偏差…

深度学习小白入门教程-基础运用篇

深度学习小白入门教程-基础运用篇 可能有图片没部署成功&#xff0c;如果有影响&#xff0c;请回小主主页PyCharm玩个文本类数据二分类第一步&#xff0c;把我们可能用到的包安排上&#xff0c;还有python的标准主函数~第二步&#xff0c;导入数据集&#xff0c;cv大法就好啦~第…

深度学习(一、入门)

从人工智能开始 让机器具有人类的智能&#xff0c;能够理解人类语言、语音、图片、视频以及各种人类活动数据&#xff0c;并以此为依托辅助甚至代替人类做出决策&#xff0c;是人工智能的终极目标。最早提到机器智能的是图灵&#xff0c;1950年&#xff0c;他提出机器是否拥有…

深度学习如何入门?

beanfrog &#xff0c;computer vision 161 人赞同 先了解个大概 A Deep Learning Tutorial: From Perceptrons to Algorithms 神经网络肯定是要学习的&#xff0c;主要是BP算法&#xff0c;可以看看PRML3、4、5三章&#xff0c;可先忽略其中的贝叶斯视角的解释。一些主要的算…

深度学习实战之Python教程(1)

Python入门教程 以熟练使用Pytorch完成深度学习模型为目标&#xff0c;简单介绍Pytorch涉及到的Python基础&#xff08;Python其它知识可以在遇到后再学习&#xff0c;先动手&#xff09;。 这篇教程并不涉及Python的复杂方法&#xff0c;教程的结构如下&#xff1a; 1…

深度学习教程(3) | 浅层神经网络(吴恩达·完整版)

作者&#xff1a;韩信子ShowMeAI教程地址&#xff1a;https://www.showmeai.tech/tutorials/35本文地址&#xff1a;https://www.showmeai.tech/article-detail/214声明&#xff1a;版权所有&#xff0c;转载请联系平台与作者并注明出处收藏ShowMeAI查看更多精彩内容 本系列为吴…