From the course: AWS Certified Solutions Architect - Associate (SAA-C03) Cert Prep

Unlock this course with a free trial

Join today to access over 25,100 courses taught by industry experts.

Global secondary index vs. local secondary index

Global secondary index vs. local secondary index

- [Speaker] Now let's review the differences between a local secondary index and a global secondary index. We already know how these indexes work as we already covered them in the DynamoDB section. In this video, we'll look at the significant areas of comparison that you may be evaluated on in the exam. Let's start off with the key attributes. In GSI, you can project a different partition key, a different sort key, or a different combination of them, plus some other non-key attributes. LSI, on the other hand, can only have a different sort key and some non-key attributes. Remember that an LSI takes the partition key of its base table, so you cannot assign a different partition key. Next, the span query. For GSIs, queries on the index can span all data in the base table across all partitions. While in a local secondary index, queries are scope locally on the partition key of its base table. You're just modifying the way you retrieve and filter data by having a different sort key. As…

Contents