Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DynamoDB: Support batching on full-load operations #249

Closed
amotl opened this issue Aug 30, 2024 · 3 comments
Closed

DynamoDB: Support batching on full-load operations #249

amotl opened this issue Aug 30, 2024 · 3 comments

Comments

@amotl
Copy link
Member

amotl commented Aug 30, 2024

Problem

The DynamoDB Table Loader does not do bulk loading yet. It needs to be implemented to transfer larger amounts of data more efficiently.

Details

if key is None:
    response = table.scan(Limit=bulk_size)
else:
    response = table.scan(ExclusiveStartKey=key, Limit=bulk_size)
@amotl
Copy link
Member Author

amotl commented Aug 30, 2024

Other than the snippet above, which may effectively just emulate creating batches of data manually, there also appears to be a native operation variant on the DynamoDB API, called BatchGetItem. It might be the right choice to use from the beginning.

I did not look into the details yet, so please advise and correct me where I am wrong. Thank you very much. 🍀

@amotl
Copy link
Member Author

amotl commented Aug 31, 2024

Contrary to my previous assessment, the BatchGetItem and BatchExecuteStatement operations are not about retrieving multiple items in bulk, but rather about submitting multiple queries within a single request.

Using the Scan operation, together with Pagination, like displayed in the code snippet in the OP, is absolutely the right choice.

@amotl amotl transferred this issue from crate/commons-codec Sep 1, 2024
@amotl
Copy link
Member Author

amotl commented Sep 2, 2024

An upcoming patch will implement the canonical Scan+Pagination procedure.

@amotl amotl closed this as completed Sep 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant