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

Unlock this course with a free trial

Join today to access over 23,200 courses taught by industry experts.

Amazon DynamoDB Global Secondary Index (GSI)

Amazon DynamoDB Global Secondary Index (GSI)

- [Instructor] Now let's talk about the two types of secondary indexes in DynamoDB. The first secondary index that we'll talk about is the Global Secondary Index, or simply GSI. Just like how it is named, the scope of queries that you can execute against a GSI is global. It means that a search can span all items in your base table, across all partitions. You can set up a global secondary index during the creation of a table or on an existing table. A DynamoDB table can have up to a default limit of 20 global secondary indexes. You can think of the GSI as a secondary table that can have a different partition key and sort key from that of your base table. So you can build a GSI that has a completely different schema design. Only projected attributes are accessible in a global secondary index. What this means is that if you try to query an item in a GSI whose original attributes are not included in the projected attribute…

Contents