Dynamodb hard
Why does the presence of a Local Secondary Index (LSI) impose a strict 10GB limit on an 'Item Collection' (all items sharing the same Partition Key)?
- A LSIs use a legacy 32-bit address space that cannot reference items beyond 10GB.
- B Locality Constraint: To guarantee strongly consistent index reads, DynamoDB must store the base items and all their LSI projections on the same physical SSD shard. This shard cannot be split across servers, so the collection must fit within the shard's logical boundary.
- C It is a safety mechanism to prevent developers from accidentally creating too many GSIs.
- D LSI data is backed up to S3 every 10GB, causing a performance pause.
Answer: B. Locality Constraint: To guarantee strongly consistent index reads, DynamoDB must store the base items and all their LSI projections on the same physical SSD shard. This shard cannot be split across servers, so the collection must fit within the shard's logical boundary.
The 'Local' in LSI means 'Physically Local'. Because LSI reads must be strongly consistent with the base table, they must exist on the same drive and be managed by the same node. If an Item Collection grew to 100GB, it would need to split across N servers, making 'Local/Strong' consistency impossible to maintain without expensive cross-node consensus. GSIs avoid this by being eventually consistent and separate.
One system design question a day, with spaced repetition so the ones you miss come back.
Get the appRelated questions
- DynamoDB has a strict 400KB limit on the size of a single item. What is the recommended design pattern if you need to store larger documents (e.g., 5MB PDFs)?
- What is the primary role of the 'Partition Key' in ensuring DynamoDB's infinite horizontal scalability?
- Why is the `Query` operation generally preferred over `Scan` for production workloads in DynamoDB?
- DynamoDB is a 'fully managed' serverless database. What is a primary operational benefit of this model for an engineering team?
- In 'Provisioned Capacity' mode, how is the performance budget of a DynamoDB table defined?
- When would an architect choose to implement DAX (DynamoDB Accelerator) in front of an existing DynamoDB table?