Ravi Sir's Cards › AWS
Keys
This comparison card contrasts Keys. GSI: New partition key (and optional sort key). LSI: Same partition key, different sort key. The card pairs GSI with most second access patterns, and LSI with alternate sort on same PK.
Read card text
What this card says
Keys
GSI
New partition key (and optional sort key).
LSI
Same partition key, different sort key.
Key points
Add anytime (with limits).
Must create with the table.
Example
Query users by email.
Use when
Most second access patterns.
Alternate sort on same PK.