Understanding Global Secondary Indexes in Amazon DynamoDB with the Rust SDK

Опубликовано: 15 Ноябрь 2024
на канале: StratusGrid
269
4

Amazon DynamoDB offers two different types of indexes, depending on how you plan to query the data from your base table. In this video, we will cover the benefits of using Global Secondary Indexes (GSI) to partition and sort your items in DynamoDB tables. GSIs are more flexible than Local Secondary Indexes (LSI) in several ways. First of all, the partition key of a GSI does not have to match the base table's partition key, unlike an LSI. Secondly, you can create up to 20 GSIs (soft limit), versus the maximum of 5 LSIs. GSIs also have their own read and write capacity units, distinct from the base table. GSIs do not allow you to fetch attributes from the base table, that have not been projected into the index, however an LSI does allow this. GSIs also cannot be queried using strongly consistent reads; you must use an LSI if you require this query feature. We will also explore how to create a GSI on an existing DynamoDB table, using the AWS SDK for Rust.