I have some time series data stored in Cassandra as name, timestamp, value.
I want to fetch data to show on a time series chart so I'm fetching the time range from Cassandra. But in order to render the chart properly I actually need the last point before the range and the first point after so that the chart line continues off the edges of the chart.
My current plan is to have two tables with identical columns, as above, but to order in ascending order of time in one and descending order of time in the other.
Then I could need to make 3 queries.
- Fetch all points inside the range from the asc table
- Fetch points from the asc table where time greater than end time limit 1. That gives me the point beyond the end.
- Fetch points from the desc table where time less than start time limit 1. That gives me the point before the start.
Is this the best way? Any Cassandra experts got any ideas?
Thanks! Chris