Re: Help on temporal data modeling

2016-09-23 Thread Peter Lin
yes it would. Whether next_billing_date is timestamp or date wouldn't make any difference on scanning all partitions. If you want to them to be on the same node, you can use composite key, but there's a trade off. The nodes may get unbalanced, so you have to do the math to figure out if your specif

Re: Help on temporal data modeling

2016-09-23 Thread Denis Mikhaylov
Thanks, for you answer. Wouldn’t simple `select * from subscriptions where next_billing_date = '2016-10-25’` require full scan of all partitions? > On 23 Sep 2016, at 14:28, Peter Lin wrote: > > > Ignoring noSql for a minute, the standard way of modeling this in car and > health insurance is

Re: Help on temporal data modeling

2016-09-23 Thread Peter Lin
Ignoring noSql for a minute, the standard way of modeling this in car and health insurance is with effective/expiration day. Commonly called bi-temporal data modeling. How people model bi-temporal models varies quite a bit from first hand experience, but the common thing is to have transaction tim

Re: Help on temporal data modeling

2016-09-23 Thread Alain RODRIGUEZ
Hi Denis, You might want to have a look at - Materialized views http://www.datastax.com/dev/blog/new-in-cassandra-3-0-materialized-views - Secondary index https://docs.datastax.com/en/cql/3.3/cql/cql_using/useWhenIndex.html My 2 cents: make sure to understand the implications before moving forwa

Help on temporal data modeling

2016-09-23 Thread Denis Mikhaylov
Hi! I have question regarding data modelling. Let’s say that I have `subscriptions` table with two columns `subscription_id text` and `next_billing_date timestamp`. How do I model a table to efficiently query all subscriptions due today (something like `where next_billing_date <= today`)