1

I have some event (belongs to a fest) which have a fest id, start time (ST), end time (ET) and event id.

A fest can have many events.

Now i have to design a data-model in such a way that i can get all the events in a fest which contain the time range T1 - T2 [ ( ST < T1 ) AND ( ET > T2 ) ].

Please suggest the most optimal way to do this.

The problem that i am facing is, we can not perform inequality query on two clustering keys if we put ST and ET as clustering keys.

Thank you.

Shubham
  • 287
  • 2
  • 7
  • don't know if this will work, but why not storing a duration column, then when you want to query you do: `Select event_id, event_st, event_duration from festTable where fest_id = id and event_st T2 ` – Whitefret Apr 29 '16 at 06:42
  • possible duplicate of http://stackoverflow.com/questions/33876872/time-series-modelling-with-start-end-date-in-cassandra – undefined_variable Apr 29 '16 at 06:54
  • @Whitefret its not working – Shubham Apr 29 '16 at 08:53
  • @Undefined_variable this solution is not valid as the range is opposite compared to given example so that we need to discard a large data which is not in range if we follow this method. – Shubham Apr 29 '16 at 08:53
  • then do 2 tables, one with event start as clustering key and the second with event end, then query both with the right where clause and compute both answers with an end – Whitefret Apr 29 '16 at 09:02
  • @Whitefret yeah i thought of this idea too but application server will have to handle lots of data which will be eventually discarded so can not take this risk. Thanks for suggestion. – Shubham Apr 29 '16 at 09:17
  • how much means a lot? because it is noSQL so you are not supposed to be limited by storing capacities – Whitefret Apr 29 '16 at 09:18

0 Answers0