Dynamodb hard
While a DynamoDB attribute can be up to 400KB, what is the maximum permissible length for a String attribute used as a Partition Key?
- A 2048 bytes (2KB)
- B 400 KB
- C 1024 bytes (1KB)
- D 255 bytes
Answer: A. 2048 bytes (2KB)
Partition keys (2048 bytes) and Sort keys (1024 bytes) are kept small for indexing efficiency. This ensures that the bloom filters and hash maps used by the DynamoDB engine remain performant and fit within high-speed cache structures. If you have extremely long unique identifiers, you should hash them (e.g., SHA-256) before using them as keys.
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?