Create secodary indexes in DynamoDB example

Each item in DynamoDB table consists of:

Fast query lookups are possible only on:

To enable fast query lookups on attributes we can create Global Secondary Index (GSI)

For example assume we have a table with game scores:

Game scores indexing

Target: Count total score by all games with one GameTitle:

As simple scan by GameTitle will be slow (because it is not hash key), we can create index GameTitleIndex which will give fast TopScores for certain GameTitle:

Secondary index

Results will be ranged(sorted) by range key.

Based on

#dynamodb #aws
Ivan Borshchov profile picture
Feb 28, 2017
by Ivan Borshchov
Did it help you?
Yes !

Best related