Pre-loading a moto dynamodb table #7654
Closed
jagoodhand
started this conversation in
General
Replies: 1 comment 5 replies
-
Hi @jagoodhand! Note that I haven't done any performance testing/investigation - it's quite a naive implementation for now. Let me know if it is helpful in any way though. |
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm using DynamoDB to cache a load of reference data - essentially acting as a dictionary lookup.
The reference data is ~600MB, and in the region of 5 million items.
Currently i'm loading this data by looping through all the items in the list of DynamoDB object dictionaries in Python and then writing them into the database using the DynamoDB batch writer.
This takes ages. And isn't really practical for running my tests.
Is there a way that I can do this more efficiently? Something like generating a database object once that I just load into the moto instance, rather than having to do it the 'proper' way?
EDIT: The proper solution for this is probably implementing the import_table method using some efficient coding to ensure the load is quick. You could then upload the data to a moto3 s3 bucket, and import it from there.
Beta Was this translation helpful? Give feedback.
All reactions