You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cassandra.apache.org by MyWorld <ti...@gmail.com> on 2022/03/09 13:25:53 UTC

Need urgent help in cassandra modelling

Hi all,

I am modelling a table for a shopping site where we store products for
customers and their data in json. Max prods for a customer is 10k.

>>We initially designed this table with the architecture below:
cust_prods(cust_id bigint PK, prod_id bigint CK, prod_data text).
cust_id is partition key, prod_id is clustering key and combination of
these is unique.

>>Now, we have a requirement to store one ordering column "prod_order
(bigint)" which is pre-calculated from service end after complex
calculation.
Further we now want to want to display products in pagination (100 per page
in order of prod_order)

Please suggest the new architecture for the table "cust_prods" so that :
1. We could be still able to update a single prod info based on cust_id +
prod_id
2. We could store data in order of "prod_order" so that fetching in
limit(pagination) becomes easy.

Note : prod_order could change for a product frequently

Regards,
Ashish

Re: Need urgent help in cassandra modelling

Posted by MyWorld <ti...@gmail.com>.
Anyone have any clue?


On Wed, Mar 9, 2022 at 7:01 PM MyWorld <ti...@gmail.com> wrote:

> Hi all,
> Some problems with the display. Resending my query-
>
> I am modelling a table for a shopping site where we store products for
> customers and their data in json. Max prods for a customer is 10k.
>
> We initially designed this table with the architecture below:
> cust_prods(cust_id bigint PK, prod_id bigint CK, prod_data text).
> cust_id is partition key, prod_id is clustering key and combination of
> these is unique.
>
> Now, we have a requirement to store one ordering column "prod_order
> (bigint)" which is pre-calculated from service end after complex
> calculation.
> Further we now want to want to display products in pagination (100 per
> page in order of prod_order)
>
> Please suggest the new architecture for the table "cust_prods" so that :
> 1. We could be still able to update a single prod info based on cust_id +
> prod_id
> 2. We could store data in order of "prod_order" so that fetching in
> limit(pagination) becomes easy.
>
> Note : prod_order could change for a product frequently
>
> Regards,
> Ashish
>
> On Wed, Mar 9, 2022 at 6:55 PM MyWorld <ti...@gmail.com> wrote:
>
>> Hi all,
>>
>> I am modelling a table for a shopping site where we store products for
>> customers and their data in json. Max prods for a customer is 10k.
>>
>> >>We initially designed this table with the architecture below:
>> cust_prods(cust_id bigint PK, prod_id bigint CK, prod_data text).
>> cust_id is partition key, prod_id is clustering key and combination of
>> these is unique.
>>
>> >>Now, we have a requirement to store one ordering column "prod_order
>> (bigint)" which is pre-calculated from service end after complex
>> calculation.
>> Further we now want to want to display products in pagination (100 per
>> page in order of prod_order)
>>
>> Please suggest the new architecture for the table "cust_prods" so that :
>> 1. We could be still able to update a single prod info based on cust_id +
>> prod_id
>> 2. We could store data in order of "prod_order" so that fetching in
>> limit(pagination) becomes easy.
>>
>> Note : prod_order could change for a product frequently
>>
>> Regards,
>> Ashish
>>
>

Re: Need urgent help in cassandra modelling

Posted by MyWorld <ti...@gmail.com>.
Hi all,
Some problems with the display. Resending my query-

I am modelling a table for a shopping site where we store products for
customers and their data in json. Max prods for a customer is 10k.

We initially designed this table with the architecture below:
cust_prods(cust_id bigint PK, prod_id bigint CK, prod_data text).
cust_id is partition key, prod_id is clustering key and combination of
these is unique.

Now, we have a requirement to store one ordering column "prod_order
(bigint)" which is pre-calculated from service end after complex
calculation.
Further we now want to want to display products in pagination (100 per page
in order of prod_order)

Please suggest the new architecture for the table "cust_prods" so that :
1. We could be still able to update a single prod info based on cust_id +
prod_id
2. We could store data in order of "prod_order" so that fetching in
limit(pagination) becomes easy.

Note : prod_order could change for a product frequently

Regards,
Ashish

On Wed, Mar 9, 2022 at 6:55 PM MyWorld <ti...@gmail.com> wrote:

> Hi all,
>
> I am modelling a table for a shopping site where we store products for
> customers and their data in json. Max prods for a customer is 10k.
>
> >>We initially designed this table with the architecture below:
> cust_prods(cust_id bigint PK, prod_id bigint CK, prod_data text).
> cust_id is partition key, prod_id is clustering key and combination of
> these is unique.
>
> >>Now, we have a requirement to store one ordering column "prod_order
> (bigint)" which is pre-calculated from service end after complex
> calculation.
> Further we now want to want to display products in pagination (100 per
> page in order of prod_order)
>
> Please suggest the new architecture for the table "cust_prods" so that :
> 1. We could be still able to update a single prod info based on cust_id +
> prod_id
> 2. We could store data in order of "prod_order" so that fetching in
> limit(pagination) becomes easy.
>
> Note : prod_order could change for a product frequently
>
> Regards,
> Ashish
>