cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sat <sathish.al...@gmail.com>
Subject Re: Designing a table in cassandra
Date Mon, 07 Nov 2016 17:37:12 GMT
Hi Carlos Alonso,

Thanks for your quick answer.

Thanks and Regards
A.SathishKumar

On Mon, Nov 7, 2016 at 2:26 AM, Carlos Alonso <info@mrcalonso.com> wrote:

> Hi,
>
> I think your best bet is, as usual, the simplest one that can work, which,
> to me, in this case is the 3rd one. Creating one single device table that
> contains the different 'versions' of the configuration during time, along
> with a flag to know wether it was updated by user or by network gives you
> all the flexibility you need. The primary key you suggest sounds good to me.
>
> To finally validate the model it would be good to know which are the
> queries you're thinking of running against this model because as you
> probably know, Cassandra models should be query driven.
>
> The suggested primary key will work for queries like "Give me the
> version(s) of this particular device_name in this particular time range"
>
> Hope it helps.
>
> Regards
>
> Carlos Alonso | Software Engineer | @calonso <https://twitter.com/calonso>
>
> On 7 November 2016 at 01:23, sat <sathish.alwar@gmail.com> wrote:
>
>> Hi,
>>
>> We are new to Cassandra. For our POC, we tried creating table and
>> inserting them as JSON and all these went fine. Now we are trying to
>> implement one of the application scenario, and I am having difficulty in
>> coming up with the best approach.
>>
>> Scenario:
>> We have a Device POJO which have some attributes/fields which are
>> read/write by users as well as network and some attributes/fields only
>> network can modify. When users need to configure they will create an
>> instance of Device POJO and set/configure applicable fields, however
>> network can update those attributes. We wanted to know the discrepancy by
>> the values configured by users versus the values updated by network. Hence
>> we have thought of 3 different approaches
>>
>> 1) Create multiple tables for the same Device like Device_Users and
>> Device_Network so that we can see the difference.
>>
>> 2) Create different Keyspace as multiple objects like Device can have the
>> same requirement
>>
>> 3) Create one "Device" table and insert one row for user configuration
>> and another row for network update. We will create this table with multiple
>> primary key (device_name, updated_by)
>>
>> Please let us know which is the best option (with their pros and cons if
>> possible) among these 3, and also let us know if there are other options.
>>
>> Thanks and Regards
>> A.SathishKumar
>>
>
>


-- 
A.SathishKumar
044-24735023

Mime
View raw message