Dynamo Local Secondary Index (Lsi)
- Definition
- contains a subset of attributes from the table
- provide you an additional sort key for your table
- Sort key consist of scalar attirbute (String, Number, Binary)
- Up to 5 Local Secondary index per table
- Usage
- To query based on attributes for DynamoDB
- LSI Must be defined at table creation time
- Attribute Projections
- Can contain some of all attributes in base tables (
KEY_ONLY
,INCLUDE
,ALL
) - Can get these attribute even though it's not projected with the index. DynamoDB will fetch it from the table
- Can contain some of all attributes in base tables (
- Use WCUs and RCUs the main table
Example
If you want to query based on Game_TS
and User_ID
without having to do manual client filtering. You have to define LSI at Game_TS