Dynamodb medium
A developer runs a `Scan` on a 50GB table. The first response returns only 20 items. What is the technical mechanism causing this limited result set?
- A The Scan operation is limited by the client's available CPU power.
- B Pagination Boundary: DynamoDB enforces a strict 1MB limit per API response. The database stops scanning once 1MB of data is processed, requiring the developer to loop using the `LastEvaluatedKey` for further results.
- C The database has detected a potential security threat and truncated the results.
- D It is an intentional delay to force developers to upgrade to a more expensive tier.
Answer: B. Pagination Boundary: DynamoDB enforces a strict 1MB limit per API response. The database stops scanning once 1MB of data is processed, requiring the developer to loop using the `LastEvaluatedKey` for further results.
DynamoDB operations (Scan and Query) are paginated to ensure system stability and predictable response times. If the dataset being scanned is large, DynamoDB will return whatever it found within the 1MB limit. If there's more data, it provides a 'token' (`LastEvaluatedKey`) which must be passed back in the next request.
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?