Search code examples
amazon-web-servicesamazon-ec2amazon-dynamodbdynamodb-queriesamazon-dynamodb-streams

Can DynamoDB reads on GSI with badly chosen partition key affect the read/write for the table


I have a DynamoDB table with a good partition key (PK=uuid) but there is a GSI (PK=type, SK=created) where type has only 6 unique values and created is epoch time.

My question is if I start to do a lot of reads with this GSI, will that affect the performance of the whole table? I see that the read capacity for both the table and the GSI is not shared according to this AWS docs but what will happen behind the scene if we start to use this GSI a lot? Will Dynamodb writes get impacted?


Solution

  • A global secondary index has separate capacity units, to avoid performance on the table itself.

    A global secondary index is stored in its own partition space away from the base table and scales separately from the base table.

    Performance on your table can only be impacted if its own credits are depleted. The global secondary index sits in its own partition space which can be treated as if has its own boundaries.

    In addition as DynamoDB uses separate credits for read (RCU) and write (WCU) these 2 actions would never have a performance impact on the other.