Reputation: 1909
i have some 200+ tables in my dynamodb. Since all my tables have localSecondaryIndexes
defined, i have to ensure that no table is in the CREATING
status, at the time of my CreateTable()
call.
While adding a new table, i list all tables and iterate through their names, firing describeTable()
calls one by one. On the returned data, i check for TableStatus
key. Each describeTable()
call takes a second. This implies an average of 3 minute waiting time before creation of each table. So if i have to create 50 new tables, it takes me around 4 hours.
How do i go about optimizing this? i think that a BatchGetItem()
call works on stuff inside the table and not table-metadata. Can i do a bulk describeTable()
call?
Upvotes: 0
Views: 133
Reputation: 12939
It is enough that you wait until the last table you created becomes ACTIVE. Run DescribeTable on that last created table with a few seconds interval.
Upvotes: 1