Question

I'll use a blog as an analogy. Our main document type has active and inactive entries in the table. Think of it like blog posts that are set to be published on a pre defined date. They also disappear on a pre defined date.

Does Cassandra offer a way to cleanly query objects basted on if they are currently active, aka active on today's date? The only option I can see is having a second table that contains the active items, along with a regular scheduled job that scans the entire main table for items that are becoming active or inactive.

Is there a neater way?

Was it helpful?

Solution

To save having to scan the entire document table, you could have a second table which contains "buckets" for which items need to be added or removed from the active list. That way you only have to scan "todays bucket" for info on what items are becoming or ceasing to be active.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top