From the course: AWS Certified Developer - Associate (DVA-C02) Cert Prep

Unlock this course with a free trial

Join today to access over 24,600 courses taught by industry experts.

Global Secondary Index (GSI) vs. Local Secondary Index (LSI)

Global Secondary Index (GSI) vs. Local Secondary Index (LSI) - Amazon Web Services (AWS) Tutorial

From the course: AWS Certified Developer - Associate (DVA-C02) Cert Prep

Global Secondary Index (GSI) vs. Local Secondary Index (LSI)

- [Narrator] 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 scoped 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