Database Reference
In-Depth Information
Murmur3Partitioner : This uses a Murmur hash to distribute the data. It per-
forms somewhat better than RandomPartitioner . It is the default partitioner
in Cassandra Version 1.2 onwards.
RandomPartitioner : This uses MD5 hashing to distribute data across the
cluster. Cassandra 1.1.x and precursors have this as the default partitioner.
ByteOrderPartitioner : This keeps keys distributed across the cluster by
key bytes. This is an ordered distribution, so the rows are stored in lexical order.
This distribution is commonly discouraged because it may cause a hotspot. (A
hotspot is a phenomenon where some nodes are heavily under load, (the hot-
spots), while others are not. Essentially, there is an uneven workload.)
One of the key benefits of partitioning data is that it allows the cluster to grow increment-
ally. What any partitioning algorithm does is it gives a consistent divisibility of data
across all available nodes. The token that a node is assigned to by the partitioner also de-
termines the node's position in the ring. Since the partitioner is a global setting, any node
in the cluster can calculate which nodes to look for in a given row key. This ability to cal-
culate data-holding nodes without knowing anything other than the row key, enables any
node to calculate what node to forward requests to. This makes the node selection process
a single-hop mechanism. The following figure shows a Cassandra ring with an alphabetic-
al partitioner, which shows keys owned by the nodes and data replication:
The previous figure shows what an Amazon Dynamo or Cassandra cluster looks like; it
looks like a ring. In this particular figure, each node or virtual node is assigned with a let-
ter as its token ID. Let's assume the partitioner in this example slices row keys based on
the first letter of the row key (no such default partitioner exists, but you can write one by
implementing IPartitioner interface which we will see in Chapter 4 , Deploying a
Cluster ). So, node D will have all the rows whose row keys start with the letters B, C, and
Search WWH ::




Custom Search