Common Facts of Dynamodb
Provisioned Throughput : ReadCapacityUnit Vs WriteCapacityUnit
- Read Throughput:
DynamoDB calculates read capacity based on 4 KB item size.
Since your item size is 153 KB, each strongly consistent read operation consumes ⌈153/4⌉=39 RCUs. If you’re performing eventually consistent reads, it would consume half of that, so 39/2=20 RCUs per read operation.
- Write Throughput:
DynamoDB calculates write capacity based on 1 KB item size.
Therefore, each write operation for your 153 KB item consume 153/1 = WCUs.
ProvisionedThroughput: { ReadCapacityUnits: 5,
WriteCapacityUnits: 5 }
Javascript visualiser : https://www.jsv9000.app/
Can we create multiple indices on same table?
Yes, we can create multiple secondary indexes on the same DynamoDB table. Secondary indexes allow us to query the data in different ways than the primary key, providing flexibility in accessing your data.
DynamoDB supports two types of secondary indexes:
- Global Secondary Indexes (GSI): A GSI is an index with a partition key and an optional sort key that is different from those on the table. GSIs allow querying on non-primary key attributes. Each GSI has its own provisioned throughput settings.
- Local Secondary Indexes (LSI): An LSI is an index that has the same partition key as the table but a different sort key. LSIs are limited to tables with composite primary keys. LSIs share the provisioned throughput settings with the table.