AWS Certified Solutions Architect - Professional 2020

Sign Up Free or Log In to participate!

LSI use cases

Hi Scott, here we have a slide on GSI use cases (the last slide) where benefits and costs are highlighted with usage of freq accessed keys or rarely accessed (freq updated/write queried) non sqls. However what would be the best use-cases for LSIs

1 Answers

Hi divc12,

You’d want to use LSIs if you needed to query on a key combination that does not include your sort key.   Take this record example:

  "MachineID" : "Q123  
  "Operation" : "Finishing",  
  "Date" : "2018-01-01"  

Let’s say you have setup MachineID as the partition key and Operation as the sort key.  That works fine for most transactions you do.  However, let’s say you want get the history of a MachineID on a specific Date.   A Local Secondary Index would be used here, because otherwise, you’d need to do a Scan if you didn’t have the LSI available.


Sign In
Welcome Back!

Psst…this one if you’ve been moved to ACG!

Get Started
Who’s going to be learning?