Simple Primary key
In a basic primary key one column uses a column name as the partition key. In this case, the primary key consists of only the partition key. Only the primary key can be specified when retrieving data from the table.
CREATE KEYSPACE Employee
WITH REPLICATION = { 'class' : 'SimpleStrategy',
'replication_factor' : 1 };
USE Employee;
CREATE TABLE Employee_info (
Employee_id UUID PRIMARY KEY,
Emp_name text,
Emp_domain text
);
Role of Keys in Cassandra
In this article, we are going to discuss why keys are important and how they are work and different from relational databases. Keys are used for grouping and organizing data into columns and rows in the database, so let’s have a look.
There are many portioning keys available in Cassandra.
1. Simple Primary key
2. Composite key
3. Using a compound primary key
Let’s discuss the concept of partitioning keys one by one.