Cluster

3 min reading

A Cluster is a collection of nodes that ScyllaDB uses to store the data. A minimum cluster typically consists of at least three nodes. Data is automatically replicated across the cluster, depending on the Replication Factor. ScyllaDB splits the data of each table into smaller units called tablets, and distributes the tablets across the nodes of the cluster. A cluster can change size over time, adding more nodes (to expand storage and processing power) or removing nodes (either through purposeful decommissioning or system failure). When a topology change occurs, the ScyllaDB cluster rebalances the data automatically by moving tablets between nodes. You can learn more about scaling and Elasticity in the Tablets, Elasticity, and X Cloud lesson. A ScyllaDB cluster can contain a minimum of three nodes, but it can also have hundreds of nodes in it. Within the ScyllaDB cluster, all internode communication is peer-to-peer, so there is no single point of failure. For communication outside of the cluster, such as a read or write, a ScyllaDB client will communicate with a single server node, called the coordinator. The selection of the coordinator is made with each client connection request to prevent bottlenecking requests through a single node. This is further explained later on in this lesson. A Partition Key is one or more columns that are responsible for data distribution across the nodes. It determines in which nodes to store a given row. As we will see later on, typically, data is replicated, and copies are stored on multiple nodes. This means that even if one node goes down, the data will still be available. It ensures reliability and fault tolerance In the example below, the Partition Key is the user_id column. A hash function turns the partition key into a number called a token. Each tablet covers a range of tokens, so the token determines which tablet holds the row, and the tablet determines which nodes (and which shard on each node) store its replicas. Every row with the same partition key lands in the same tablet, on the same replica nodes. ScyllaDB does all of this transparently: you only choose the partition key.

The partition key is hashed into a token, which maps to a tablet and its replica nodes
The partition key is hashed into a token, which maps to a tablet and its replica nodes

Learn more about partition keys in the Basic Data Modeling lesson.


Something wrong with this lesson? Tell us