DynamoDB Scan VS Query VS Put
2 min readApr 17, 2024
DynamoDB scan :
- It is function to retrives all items in your table similar to mysql select * from tablename.
- It filter down results with Filterexpressions.
- Its very expensive and should be avoidable in production apps.
- Supports parallel scans using multi-threading
- It can return only 1 MB of worth of the data per call, extra data needs to paginations.
Query :
- Queries allows you to retrive data with a partition key + range key.
- Use RangeKey’s condition expressions to further narrow results.
- You can also query on Global secondary indexes.
- It has much better performance than scan as O(1).
- Its cost effective but may require careful thought of your schema.
When to use what ?
Scan : No
Query: Many records and more conditions.
GetItem: Specific key and more efficinecy.

Can put method can push 38k of records?
The put method in DynamoDB can indeed handle inserting a large number of records, including 38,000 records. However, there are a few considerations to keep in mind:
- Item Size Limit: Each item you insert into DynamoDB must not exceed 400 KB in size. If you’re inserting a large number of records, ensure that each individual record does not exceed this size limit.
- Provisioned Throughput: DynamoDB has provisioned throughput limits, which include both read and write capacity units. If you’re inserting a large number of records, you need to ensure that your table has sufficient write capacity units to handle the write throughput required for the number of records you’re inserting.
- Batch Writes: To efficiently insert a large number of records, you can use the
BatchWriteItem
operation instead of individualput
requests. This allows you to write multiple items to one or more tables in a single request, reducing the number of API calls required and potentially improving performance. - Backoff and Retry Logic: When performing large-scale writes, it’s important to implement appropriate backoff and retry logic to handle throttling and other transient errors that may occur.