Arangodb 简明教程

Basic Concepts and Terminologies

在本章中,我们将讨论 ArangoDB 的基本概念和术语。了解与我们正在处理的技术主题相关的基本术语非常重要。

In this chapter, we will discuss the basic concepts and terminologies for ArangoDB. It is very important to have a knowhow of the underlying basic terminologies related to the technical topic we are dealing with.

ArangoDB 的术语如下:

The terminologies for ArangoDB are listed below −

  1. Document

  2. Collection

  3. Collection Identifier

  4. Collection Name

  5. Database

  6. Database Name

  7. Database Organization

从数据模型的角度来看,ArangoDB 可以被认为是一个面向文档的数据库,因为文档的概念是后者的一个数学理念。面向文档的数据库是 NoSQL 数据库的一个主要类别。

From the perspective of data model, ArangoDB may be considered a document-oriented database, as the notion of a document is the mathematical idea of the latter. Document-oriented databases are one of the main categories of NoSQL databases.

层次关系如下:文档被分组为集合,集合存在于数据库中。

The hierarchy goes like this: Documents are grouped into collections, and Collections exist inside databases

应该很明显,标识符和名称是集合和数据库的两个属性。

It should be obvious that Identifier and Name are two attributes for the collection and database.

通常,存储在文档集合中的两个文档(顶点)通过存储在边集合中的文档(边)链接。这是 ArangoDB 的图表数据模型。它遵循有向标记图的数学概念,只不过边不仅具有标签,而且是成熟的文档。

Usually, two documents (vertices) stored in document collections are linked by a document (edge) stored in an edge collection. This is ArangoDB’s graph data model. It follows the mathematical concept of a directed, labeled graph, except that edges don’t just have labels, but are full-blown documents.

熟悉了此数据库的核心术语后,我们开始理解 ArangoDB 的图表数据模型。在此模型中,存在两种类型的集合:文档集合和边集合。边集合存储文档,还包含两个特殊属性:第一个是 _from 属性,第二个是 _to 属性。这些属性用于在文档之间创建边(关系),这对图形数据库至关重要。在图形的上下文中,文档集合也称为顶点集合(请参见任何图论书籍)。

Having become familiar with the core terms for this database, we begin to understand ArangoDB’s graph data model. In this model, there exist two types of collections: document collections and edge collections. Edge collections store documents and also include two special attributes: first is the _from attribute, and the second is the _to attribute. These attributes are used to create edges (relations) between documents essential for graph database. Document collections are also called vertex collections in the context of graphs (see any graph theory book).

现在让我们看看数据库有多么重要。它们很重要,因为数据库内存在集合。对于 ArangoDB 的一个实例,可以有一个或多个数据库。不同的数据库通常用于多租户设置,因为它们内部的不同数据集(集合、文档等)彼此孤立。默认数据库 _system 是特殊的,因为它无法被删除。用户在此数据库中被管理,其凭据对于服务器实例的所有数据库都是有效的。

Let us now see how important databases are. They are important because collections exist inside databases. In one instance of ArangoDB, there can be one or many databases. Different databases are usually used for multi-tenant setups, as the different sets of data inside them (collections, documents, etc.) are isolated from one another. The default database _system is special, because it cannot be removed. Users are managed in this database, and their credentials are valid for all the databases of a server instance.