So far, you’ve learnt about three useful data modeling features in ScyllaDB:
Materialized view
Secondary index and local secondary index
Filtering
Let’s discuss which option is the most appropriate and when.
Transcript
So far, you’ve learnt about three useful data modeling features in ScyllaDB:
Materialized view
Secondary index and local secondary index
Filtering
Let’s discuss which option is the most appropriate and when.
Rule of thumb:
If you want no storage overhead at all, use FILTERING. In this case read performance might be low.
If performance is more important than storage overhead, then use MVs.
If most of your queries specify the partition key, local secondary index will be faster then global secondary index.
If most of your queries cover multiple partitions, local indexes won’t be helpful. In this case, a global secondary index might provide the best performance.
If the query result includes most of the rows, then FILTERING might be better than indexes.
Pros and cons
This table gives you a high-level overview of the write and read performance implications and the storage impact of each option:
Each use case is unique. Refer to this flowchart to help you decide: