Re: Reading Data from C* Cluster

2018-05-25 Thread Alain RODRIGUEZ
Hello,

Where I can have configurable codes in partition key as cassandra supports.
>

I am sorry I don't understand this.

1) How much data I can put in one partition ?
>

Well, Cassandra supports huge partitions. In practice, the value of 100 MB
per partition is often shared. I consider it's a good 'soft' limit.
Basically, with such a small table/strings combination, you will probably
not reach limits any time soon unless the workload is really intensive. The
hard limit is kind of irrelevant I would say, Cassandra will be working
poorly before reaching it that the precise value does not matter much.

Nonetheless, make sure to pick a good partition key. A good partition key
should be ideally, meaningful and allow you to retrieve all the data you
need querying one partition (or just a few). A good partition key should
also allow the partitions/rows to all have a similar size (as much as
possible) and to be distributed evenly in the token ring as well (using a
date as the partition key for example, will induce all the request for this
date to only hit a small portion of the servers - 1 server and its replica
only). All the fragments of the same partition go to 1 node (and to the
corresponding replicas). It is easy to create imbalances.

It is really important to pick this key appropriately considering these
best practices/constraints.

2) I want to read data from cassandra as
> SELECT * from code where campaign_id_sub_partition = 'XXX-1';
> Is reading whole partition at one time is feasible or shall I use
> pagination ?
>

 I would make sure to use a client that uses pagination under the hood.
Modern clients do it for you. Depending on the size of the partition, the
pagination will be useless, nice to have or mandatory not to reach the
timeout. But I would really try not to implement this and pick some client
that do that already.

C*heers,
---
Alain Rodriguez - @arodream - al...@thelastpickle.com
France / Spain

The Last Pickle - Apache Cassandra Consulting
http://www.thelastpickle.com


2018-05-24 19:55 GMT+01:00 raman gugnani :

> HI
>
> I want to read data from C* Cluster.
>
> Schema is
>
> CREATE TABLE code(
> campaign_id_sub_partition text
> code text,
> PRIMARY KEY ((campaign_id_sub_partition),code))
> );
>
> Where I can have configurable codes in partition key as cassandra supports.
> campaign_id_sub_partition is appx 10 characters
> code field is appx 12~20 characters
>
>
> Query :
> 1) How much data I can put in one partition ?
>
> 2) I want to read data from cassandra as
> SELECT * from code where campaign_id_sub_partition = 'XXX-1';
> Is reading whole partition at one time is feasible or shall I use
> pagination ?
>
> --
> Raman Gugnani
>
> 8588892293
>
>


Reading Data from C* Cluster

2018-05-24 Thread raman gugnani
HI

I want to read data from C* Cluster.

Schema is

CREATE TABLE code(
campaign_id_sub_partition text
code text,
PRIMARY KEY ((campaign_id_sub_partition),code))
);

Where I can have configurable codes in partition key as cassandra supports.
campaign_id_sub_partition is appx 10 characters
code field is appx 12~20 characters


Query :
1) How much data I can put in one partition ?

2) I want to read data from cassandra as
SELECT * from code where campaign_id_sub_partition = 'XXX-1';
Is reading whole partition at one time is feasible or shall I use
pagination ?

-- 
Raman Gugnani

8588892293