educative.io

What's the difference between the 2 advantages for range based queries

Hey there,

Loving the course. I didn’t understand what the difference was between the 2 advantages of range based queries. Both of them seemed to boil down to “range based queries are efficient”. Is there something more that is being said here that i’m not getting?

Advantages
  • Using this method, the range-query-based scheme is easy to implement.
  • Range queries can be performed using the partitioning keys, and those can be kept in partitions in sorted order.

Course: Grokking Modern System Design Interview for Engineers & Managers - Learn Interactively
Lesson: Data Partitioning - Grokking Modern System Design Interview for Engineers & Managers


Course: Grokking Modern System Design Interview for Engineers & Managers - Learn Interactively
Lesson: https://www.educative.io/courses/grokking-modern-system-design-interview-for-engineers-managers/qAQ2rAVLrBk

Hi @Amit_L_Wadhwani,
Yes, your observation is correct that both of our advantages are related to performance enhancement. However, these performance improvements originate from different sources. The first advantage is based on our ability to quickly access the exact node and shard required for the query. The second advantage is related to the physical layout of data, allowing us to retrieve the required data quickly (possibly by using a secondary index on the partition key). We hope the above explanation answers your question. Happy learning!