Re: Wide Rows - Data Model Design
Hello, Yes, this is a wide row table design. The first col is your Partition Key. The remaining 2 cols are clustering cols. You will receive ordered result sets based on client_name, record_date when running that query. Jonathan [image: datastax_logo.png] Jonathan Lacefield Solution Architect | (404) 822 3487 | jlacefi...@datastax.com [image: linkedin.png] http://www.linkedin.com/in/jlacefield/ [image: facebook.png] https://www.facebook.com/datastax [image: twitter.png] https://twitter.com/datastax [image: g+.png] https://plus.google.com/+Datastax/about http://feeds.feedburner.com/datastax https://github.com/datastax/ On Fri, Sep 19, 2014 at 10:41 AM, Check Peck comptechge...@gmail.com wrote: I am trying to use wide rows concept in my data modelling design for Cassandra. We are using Cassandra 2.0.6. CREATE TABLE test_data ( test_id int, client_name text, record_data text, creation_date timestamp, last_modified_date timestamp, PRIMARY KEY (test_id, client_name, record_data) ) So I came up with above table design. Does my above table falls under the category of wide rows in Cassandra or not? And is there any problem If I have three columns in my PRIMARY KEY? I guess PARTITION KEY will be test_id right? And what about other two? In this table, we can have multiple record_data for same client_name. Query Pattern will be - select client_name, record_data from test_data where test_id = 1;
Re: Wide Rows - Data Model Design
Does my above table falls under the category of wide rows in Cassandra or not? -- It depends on the cardinality. For each distinct test_id, how many combinations of client_name/record_data do you have ? By the way, why do you put the record_data as part of primary key ? In your table partiton key = test_id, client_name = first clustering column, record_data = second clustering column On Fri, Sep 19, 2014 at 5:41 PM, Check Peck comptechge...@gmail.com wrote: I am trying to use wide rows concept in my data modelling design for Cassandra. We are using Cassandra 2.0.6. CREATE TABLE test_data ( test_id int, client_name text, record_data text, creation_date timestamp, last_modified_date timestamp, PRIMARY KEY (test_id, client_name, record_data) ) So I came up with above table design. Does my above table falls under the category of wide rows in Cassandra or not? And is there any problem If I have three columns in my PRIMARY KEY? I guess PARTITION KEY will be test_id right? And what about other two? In this table, we can have multiple record_data for same client_name. Query Pattern will be - select client_name, record_data from test_data where test_id = 1;
Re: Wide Rows - Data Model Design
@DuyHai - I have put that because of this condition - In this table, we can have multiple record_data for same client_name. It can be multiple combinations of client_name and record_data for each distinct test_id. On Fri, Sep 19, 2014 at 8:48 AM, DuyHai Doan doanduy...@gmail.com wrote: Does my above table falls under the category of wide rows in Cassandra or not? -- It depends on the cardinality. For each distinct test_id, how many combinations of client_name/record_data do you have ? By the way, why do you put the record_data as part of primary key ? In your table partiton key = test_id, client_name = first clustering column, record_data = second clustering column On Fri, Sep 19, 2014 at 5:41 PM, Check Peck comptechge...@gmail.com wrote: I am trying to use wide rows concept in my data modelling design for Cassandra. We are using Cassandra 2.0.6. CREATE TABLE test_data ( test_id int, client_name text, record_data text, creation_date timestamp, last_modified_date timestamp, PRIMARY KEY (test_id, client_name, record_data) ) So I came up with above table design. Does my above table falls under the category of wide rows in Cassandra or not? And is there any problem If I have three columns in my PRIMARY KEY? I guess PARTITION KEY will be test_id right? And what about other two? In this table, we can have multiple record_data for same client_name. Query Pattern will be - select client_name, record_data from test_data where test_id = 1;
Re: Wide Rows - Data Model Design
Ahh yes, sorry, I read too fast, missed it. On Fri, Sep 19, 2014 at 5:54 PM, Check Peck comptechge...@gmail.com wrote: @DuyHai - I have put that because of this condition - In this table, we can have multiple record_data for same client_name. It can be multiple combinations of client_name and record_data for each distinct test_id. On Fri, Sep 19, 2014 at 8:48 AM, DuyHai Doan doanduy...@gmail.com wrote: Does my above table falls under the category of wide rows in Cassandra or not? -- It depends on the cardinality. For each distinct test_id, how many combinations of client_name/record_data do you have ? By the way, why do you put the record_data as part of primary key ? In your table partiton key = test_id, client_name = first clustering column, record_data = second clustering column On Fri, Sep 19, 2014 at 5:41 PM, Check Peck comptechge...@gmail.com wrote: I am trying to use wide rows concept in my data modelling design for Cassandra. We are using Cassandra 2.0.6. CREATE TABLE test_data ( test_id int, client_name text, record_data text, creation_date timestamp, last_modified_date timestamp, PRIMARY KEY (test_id, client_name, record_data) ) So I came up with above table design. Does my above table falls under the category of wide rows in Cassandra or not? And is there any problem If I have three columns in my PRIMARY KEY? I guess PARTITION KEY will be test_id right? And what about other two? In this table, we can have multiple record_data for same client_name. Query Pattern will be - select client_name, record_data from test_data where test_id = 1;