0

I have to save data in 6 tables in dynamoDB AWS, can I put a 'for' loop and save one by one as shown below :-

DynamoDBMapper mapper = new DynamoDBMapper(dynamoDB);
for(i=0;i<6;i++)
{
mapper.save(<TABLE 1 DATA>)
// and loop and save data in every table
}

Does it looks fine or it can create some problem as I am doing data base operation in loop? My tables are very small(5 columns)

Thanks Kailash

2 Answers 2

1

Running in the for loop is a bad idea and you can use the batch write item api. dynamoDB.batchWriteItem(TableWriteItems... yourMultipleTableWriteItems)

Sign up to request clarification or add additional context in comments.

Comments

0

If you only need to download the data from the table into a local file, like CSV, for example, you can use this CLI tool https://github.com/zshamrock/dynocsv to export data from your table into the CSV file.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.