Orientdb 简明教程
OrientDB - Create Cluster
Cluster 是 OrientDB 中的一个重要概念,用于存储记录、文档或顶点。简单来说,集群是一个存储一组记录的地方。默认情况下,OrientDB 将为每个类创建一个集群。某个类的所有记录都存储在同一个集群中,该集群具有与该类相同名称。可以在数据库中创建多达 32767(2^15-1)个集群。
Cluster is an important concept in OrientDB which is used to store records, documents, or vertices. In simple words, cluster is a place where a group of records are stored. By default, OrientDB will create one cluster per class. All the records of a class are stored in the same cluster, which has the same name as the class. You can create up to 32,767(2^15-1) clusters in a database.
CREATE class 是一个用于创建特定名称集群的命令。创建集群后,您可以在创建任何数据模型期间指定名称,使用集群来保存记录。如果您想向类中添加一个新集群,请使用 Alter Class 命令和 ADDCLUSTER 命令。
The CREATE class is a command used to create a cluster with a specific name. Once the cluster is created, you can use the cluster to save records by specifying the name during the creation of any data model. If you want to add a new cluster to a class, use Alter Class command and ADDCLUSTER command.
以下语句是 Create Cluster 命令的基本语法。
The following statement is the basic syntax of Create Cluster command.
CREATE CLUSTER <cluster> [ID <cluster-id>]
其中 <cluster> 定义所要创建的集群的名称, <cluster-id> 定义所要用于该集群的数字 ID。
Where <cluster> defines the name of the cluster you want to create and <cluster-id> defines the numeric ID you want to use for the cluster.
下表提供了集群选取策略列表。
The following table provides the list of Cluster selection strategies.
Sr.No. |
Strategy & Description |
1 |
Default Selects the cluster using the class property default ClusterId. |
2 |
Round-robin Selects the next cluster in a circular order. It is restarting once complete. |
3 |
Balanced Selects the smallest cluster. Allows the class to have all underlying clusters balanced on size. When adding a new cluster to an existing class, it fills the new cluster first. |