Tech Note
Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Back to homepage

GSIs in DynamoDB

Some notes on what to consider when adding a new GSI to a DynamoDB table, particularly one that is already being used in production:

  • If the GSI is based on a string attribute that is already being used, make sure your code is not trying to store the blank string. DynamoDB will refuse to store the attribute value. Not setting the attribute at all is fine — I assume they just won’t get put into the index — but blank values will not work.
  • Backfilling begins and will run asynchronously once the GSI is created, using CloudFormation or otherwise (see docs).