v1.10

Document

How to Start SequoiaDB

Basic Operation

Data Model

Database Management

Aggregation

Index

Replication

Cluster

Connector

Reference

Development

Release Note

FAQ

  • Content
  • Comments
  • History

Sharding Key

Concept

Sharding key difines the sharding rules of data in every collection. Every colleciton corresponds a sharding key. A sharding key contains one or more fields.

In catalog node, every collection has its own sharding range. In sharding range, every range segment corresponds to a sharding group, which shows that certain data segment is in the sharding group.

Note:

When creating a collection, index key of it is specified. After collection is created, index key is unalterable.

sharded collection, after a record is inserted into database, the sharding key is not allowed to be updated.

Format

  • Range sharding Key

    The format of sharding key is similar to index key, which is a JSON object. Every field in JSON object corresponds to a field in sharding key. The value is "1" or "-1", respectively representing forward order or reverse order.

    { <field 1> : <1|-1> [, <field 2> : <1|-1> ...] }
  • Hash partition Sharding Key composition identical with Range partitioning (but field forward/reverse does not work).Partition represents a hash slice number. The default is 2^12, on behalf of our entire range is divided into 4096 the average slice. Design hash fragmentation purpose is to allow data distribution is more flesible and can be freely set each bear hash slice data partition range. Sharding Type if you do not fill it defaults to Reange partition.
    {ShardingKey:{<field 1>:<1|-1> [,<field 2>:<1|-1>, ...]}, {ShardingType:"hash"}  [, {Partition:<number of fragments>}]}
Sample
  • { Field1 : 1, Field2 : -1 }
  • Hash Sharding Key
    {{ Field1 : 1, Field2 : -1 },{ShardingType:"hash"},{Partition:2^12}}
please login to comment.
Latest Comment
  • 2015-02-15

About Us

SequoiaDB is a financial-level distributed database vendor and is the first Chinese database listed in Gartner’s Magic Quadrant OPDBMS report. SequoiaDB has recently released version 3.0.
SequoiaDB is now penetrating the vertical sector Financial Industry quickly and had more than 50 banking clients and hundreds of enterprise customers in industries including government, telecommunication, Internet and IoT.

Beijing:
Tower R, No.8 North Star East Road, Chaoyang District, Beijing,China
Guangzhou:
Tower A, No.22 Qinglan Street, Panyu District, Guangzhou,China
Shenzhen:
Tsing Hua Tech Park, Nanshan District, Shenzhen,China
Tel:400-8038-339
E-mail:contact@sequoiadb.com