Data partitioning for Cassandra databases

Source: Internet
Author: User
Tags cassandra

When starting the Cassandra cluster, you need to choose how the data is divided in the cluster, which is done by Partitioner.

All data managed in cluster is represented by the cyclization (ring). The loop is divided into a range (range) that equals the number of nodes. When each node joins the cluster, a token (token) is issued that determines the location of the node in the loop and the range of the data that is responsible for it.

Column Family (the table that corresponds to the relational database) is based on the partition.

To configure partitioner, you need to specify a partitioning policy:

More Wonderful content: http://www.bianceng.cnhttp://www.bianceng.cn/database/extra/

Randompartitioner (Random partitioning): This is the default partitioning policy in the Cassandra Cluster, which uses a consistent hash algorithm. This algorithm explains in detail:

Http://www.cnblogs.com/coser/archive/2011/11/06/2238359.html

The advantage of this strategy is that once you have token assigned, column family data is distributed evenly across multiple cluster nodes and simplifies load balancing. The reading and writing of column family data is also average.

Orderedpartitioner (sorted partition): This Cassandra cluster is not recommended.

This must ensure that all key is sorted.

We looked at our system's partitioning policy choices:

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.