Illustration: Partitioning
Get a hands-on demonstration of partitioning by creating a keyspace and table, inserting data, and observing how the records are distributed across the nodes in the cluster.
We'll cover the following...
We'll cover the following...
Illustration
To demonstrate partitioning, let’s create a simple table and insert some rows to see how they are distributed around the cluster.
Creating container keyspace for the table
A keyspace holds a related set of tables and defines the number of nodes that store copies of each row.
A replication_factor
of 2 means each row of each table in this keyspace will be stored twice in the cluster—on two different nodes.
The USE <KEYSPACE>
command selects the keyspace for all subsequent queries. Notice that cqlsh:>testkeyspace
displaying testkeyspace
has been selected for the ...