I want to create a DynamoDB table with a GSI. For this GSI, currently I need only PartitionKey because I want to query by only one attribute. But in future I may need to query by other attributes. So, I am thinking of adding a SortKey just in case if I need to query by another attribute in future. For now it can be empty or can have the same value as PK.
In GSI, are there any drawbacks of adding SortKey, if I am not planning to use it in foreseeable future? Thank you.
CodePudding user response:
The (probably very) minor downsides of this approach are:
- marginally higher storage costs and
- added developer overhead of having to provide the (currently meaningless) index SK as part of the primary Key in CRUD operations.