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

Unlock this course with a free trial

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

Amazon DynamoDB Local Secondary Index (LSI)

Amazon DynamoDB Local Secondary Index (LSI)

- [Instructor] Now let's look at the other type of secondary index in DynamoDB, which is the Local Secondary Index or LSI. In a global secondary index, a query on the index can span all of the data in the base table across all partitions. In a Local Secondary Index, searches are limited to a single partition. A Local Secondary Index allows you to create an index where you can use a non-key attribute from its base table as a sort key. The data partitions in LSI are automatically organized by DynamoDB using the partition key of its base table. In simpler terms, a Local Secondary Index maintains the same partition key of its base table, but it has a different sort key. So when you create an LSI, you only need to specify the sort key and the attributes that you'd like to project. Unlike GSI, the only time that you can create a Local Secondary Index is during the creation of a table. Creating an LSI on an existing table is not possible. The Local Secondary Index uses the provision…

Contents