Home > Back-end >  AWS DynamoDB LSI item collection size limit
AWS DynamoDB LSI item collection size limit

Time:02-17

I'm trying to understand what really AWS DynamoDB behaviour is. When I create a Local Secondary Index (LSI) for the table, documentation says, that there is 10 GB limit for the item collection. Docs

What does it really means?

Let's say my data is partitioned across 3 partitions, so questions are:

  • each partition will have 10GB limit for LSI or in general across all partitions?
  • If i reached a limit, let's say, I continue to write data to the table, that means that data will be in the table, but not seen by LSI? Or how? I understand it that in general data will be available in the table, but if I will query by LSI it will show me just old items, that we succeed to write before reached a limit, but if I will scan all table - I will see all items (old and new)? Right?

Will appreciate for any help Thanks

Possible answer:

This post helped me to understand If items with the same partition key exceeds 10GB, how would LSI works?

It will raise exception in case we will reach a limit of 10GB for specific item collection(any group of items that have the same partition key value in a table and all of its local secondary indexes).

So if amount of items with specific partition key is not that big - you are save to use LSI.

CodePudding user response:

You are misreading the docs...

The Item Collection Size Limit applies to the table itself...

The maximum size of any item collection is 10 GB. This limit does not apply to tables without local secondary indexes. Only tables that have one or more local secondary indexes are affected.

So if you have a table with an LSI, then you can not have more than 10GB for any given partition key in the table.

If you have lots of data, paying to have a GSI with the same partition key as the table but a different sort key instead of a free LSI if needed is a solution.

  • Related