Re: Help with data modelling (from MySQL to Cassandra)

2017-03-27 Thread Zoltan Lorincz
Great suggestion! Thanks Avi! On Mon, Mar 27, 2017 at 3:47 PM, Avi Kivity wrote: > You can use static columns to and just one table: > > > CREATE TABLE documents ( > > doc_id uuid, > > element_id uuid, > > description text static, > > doc_title text static, > > element_title

Re: Help with data modelling (from MySQL to Cassandra)

2017-03-27 Thread Avi Kivity
You can use static columns to and just one table: CREATE TABLE documents ( doc_id uuid, element_id uuid, description text static, doc_title text static, element_title text, PRIMARY KEY (doc_id, element_id) ); The static columns are present once per unique doc_id.

Re: Help with data modelling (from MySQL to Cassandra)

2017-03-27 Thread Zoltan Lorincz
Thank you Matija, because i am newbie, it was not clear for me that i am able to query by the partition key (not providing the clustering key), sorry about that! Zoltan. On Mon, Mar 27, 2017 at 1:54 PM, Matija Gobec wrote: > Thats exactly what I described. IN queries can be used sometimes but I

Re: Help with data modelling (from MySQL to Cassandra)

2017-03-27 Thread Matija Gobec
Thats exactly what I described. IN queries can be used sometimes but I usually run parallel async as Alexander explained. On Mon, Mar 27, 2017 at 12:08 PM, Zoltan Lorincz wrote: > Hi Alexander, > > thank you for your help! I think we found the answer: > > CREATE TABLE documents ( > doc_id uu

Re: Help with data modelling (from MySQL to Cassandra)

2017-03-27 Thread Zoltan Lorincz
Hi Alexander, thank you for your help! I think we found the answer: CREATE TABLE documents ( doc_id uuid, description text, title text, PRIMARY KEY (doc_id) ); CREATE TABLE nodes ( doc_id uuid, element_id uuid, title text, PRIMARY KEY (doc_id, element_id) ); We

Re: Help with data modelling (from MySQL to Cassandra)

2017-03-26 Thread Alexander Dejanovski
Hi Zoltan, you must try to avoid multi partition queries as much as possible. Instead, use asynchronous queries to grab several partitions concurrently. Try to send no more than ~100 queries at the same time to avoid DDOS-ing your cluster. This would leave you roughly with 1000+ async queries gro

Re: Help with data modelling (from MySQL to Cassandra)

2017-03-26 Thread Zoltan Lorincz
Querying by (doc_id and element_id ) OR just by (element_id) is fine, but the real question is, will it be efficient to query 100k+ primary keys in the elements table? e.g. SELECT * FROM elements WHERE element_id IN (element_id1, element_id2, element_id3, element_id100K+) ? The elements_id

Re: Help with data modelling (from MySQL to Cassandra)

2017-03-26 Thread Matija Gobec
Have one table hold document metadata (doc_id, title, description, ...) and have another table elements where partition key is doc_id and clustering key is element_id. Only problem here is if you need to query and/or update element just by element_id but I don't know your queries up front. On Sun,

Help with data modelling (from MySQL to Cassandra)

2017-03-26 Thread Zoltan Lorincz
Dear cassandra users, We have the following structure in MySql: documents->[doc_id(primary key), title, description] elements->[element_id(primary key), doc_id(index), title, description] Notation: table name->[column1(key or index), column2, …] We want to transfer the data to Cassandra. Each