Search⌘ K

Demo: Using A Local Secondary Index

Understand how to create a DynamoDB table with a local secondary index and use it to perform efficient queries. Learn to fetch player scores and top scorers in a game by deploying batch writes and query commands that leverage strong consistency using LSIs.

Creating a LSI

Let’s take an example that requires strong consistency. Imagine a simple game table, FightClubGame. This table consists of three attributes, namely: GameId, PlayerId, and Score.

GameId PlayerId Score
“1” “a” 150
“1” “b” 35
“1” “c” 50
“1” “d” 45
“2” “d” 10

Let’s support the following two access patterns.

  1. Fetch the score for a player in a particular game. ...