Home › Forums › AWS › AWS Certified DevOps Engineer Professional › Local vs global secondary indices – why is this answer correct? › Reply To: Local vs global secondary indices – why is this answer correct?
-
Hi Carlo,
Thanks for the reply, but it contradicts the official documentation, which says “In general, you should use global secondary indexes rather than local secondary indexes”. I can’t find anything that says you should prefer LSIs when the partition key is the same, or that creating a GSI with the same partition key “defeats its purpose”.
It’s not official, but here’s a great article that gives a flowchart showing when you should choose GSI over a LSI, and when I follow the flowchart, it’s clear that the right answer in this scenario is a GSI: https://www.dynamodbguide.com/local-or-global-choosing-a-secondary-index-type-in-dynamo-db/
Mason