Cassandra | Inserting data into two column families with the same row key

127 Views Asked by At

If I have 2 column families one for customer info and another for customer address info, how can I insert customer info and their address info to the two separate column families with the same row key(customer id) ?

1

There are 1 best solutions below

0
On

Use the batch insert.

BEGIN BATCH
  DML for insert into customer info ;
  DML for insert into customer address info, ;
APPLY BATCH ;

Why do you need two tables with the same primary? Can't you club them into one?