0
votes

@here: i have a question related to cassandra partitioning , if i create below tables 2 tables below 2 tables we will be querying based on group_id, hence created partitioning on group_id with same values of group_id in different tables, will the data for these tables will go to same cassandra nodes i understand they go to different ss_tables, but when token gets generated partition key with same value of 2 different tables will they be on same nodes ? these 2 tables are very small with 100 groups at max in each table hardly per group_id it might have 1000 services in first ---primary key(group_id,serv_id) hardly per group_id it might have 1000 categories in second --primary key(group_id,category_id)

as the row partition_value is same, in this case group_id for both might be present with same values will they go to same nodes and create a any hotspots of data ?

CREATE TABLE services (
serv_id TEXT,
name TEXT,
description TEXT,
configuration_services SET<TEXT>,
data_services SET<TEXT>,
monitor_services SET<TEXT>,
command_services SET<TEXT>,
created_by TEXT,
created_at TIMESTAMP,
modified_by TEXT,
modified_at TIMESTAMP,
enable boolean,
group_id text,
primary key(group_id,serv_id)
) ;

CREATE TABLE categories (
category_id UUID,
name TEXT,
description TEXT,
category TEXT, [CONFIGURATION/COMMAND/DATA/MONITOR]
characteristics Set<TEXT>,
created_by TEXT,
created_at TIMESTAMP,
modified_by TEXT,
modified_at TIMESTAMP,
enable boolean,
group_id text,
roles_allowed MAP<TEXT,TEXT> // role based permissions.
primary key(group_id,category_id)
) ;
1

1 Answers

0
votes

As long as tables have same replication factor, keyspace and partition key, they stored on the same node.