Search⌘ K
AI Features

Introduction to Secondary Indexes In DynamoDB

Explore how secondary indexes in DynamoDB expand query options beyond primary keys and scans. Understand the differences between global and local secondary indexes, their benefits, and trade-offs related to cost, speed, and maintenance. This lesson helps you leverage secondary indexes effectively to improve data access patterns and manage provisioning in DynamoDB.

Utility of secondary indexes

We have seen how we can query on primary keys or scan the table. Both the options for reading data have their respective trade-offs. Querying on the primary key is fast, but it can only give us a limited set of access patterns. The scan can give us any access pattern, but it is slow and costly. There is a third way, using a secondary index, which is relatively cheap and provides us with more access patterns.

...