Introduction to Secondary Indexes In DynamoDB

preview_player
Показать описание
Introduction to Secondary Indexes In DynamoDB
06Introduction to Secondary Indexes In DynamoDB

Introduction to Secondary Indexes In DynamoDB
Understand the basics of the local secondary indexes and global secondary indexes.

We'll cover the following

Utility of secondary indexes
Types of secondary indexes
Considerations while choosing secondary indexes
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.

Global Secondary Index
Understand GSI with an example.

We'll cover the following

Example scenario
Data model
Index key
Attributes
Cost structure
Read cost
Write cost
Example scenario#
Imagine that we are creating a database for songs. We choose “Artist” as the partition key and “Song_title” as the sort key. The other attributes in the table are “Album”, “Genre”, and “Year”.

The envisioned database will look like this:

-~-~~-~~~-~~-~-
Please watch: "01 05 Why Google Cloud Platform "
-~-~~-~~~-~~-~-
Рекомендации по теме