tag:blogger.com,1999:blog-9238405.post609127693527231417..comments2024-03-18T02:04:50.380-07:00Comments on Agile Testing: The correct way of using DynamoDB BatchWriteItem with botoGrig Gheorghiuhttp://www.blogger.com/profile/17863511617654196370noreply@blogger.comBlogger2125tag:blogger.com,1999:blog-9238405.post-70980739640296976782012-05-15T07:06:06.179-07:002012-05-15T07:06:06.179-07:00That's a great tip, Jonathan! Thanks so much f...That's a great tip, Jonathan! Thanks so much for sharing it.Grig Gheorghiuhttps://www.blogger.com/profile/17863511617654196370noreply@blogger.comtag:blogger.com,1999:blog-9238405.post-20205083720665703412012-05-14T18:33:01.093-07:002012-05-14T18:33:01.093-07:00Very good advice. I had to do something similar w...Very good advice. I had to do something similar when I was writing the batch_get with boto. I just kept iterating over the results when there were "Unprocessed" keys. <br /><br />However one thing we added (and I would suggest here for anyone using this in production code) is to set some sort of a limit on the number of times you keep trying. If there was an item that just couldn't be added to Dynamo (or couldn't be retrieved in a batch_get) - you'd get stuck in an infinite loop trying to fetch the item.<br /><br />It's probably unlikely - but relying on Dynamo to always (eventually) return an item or always allow you to put an item is probably a bad idea.<br /><br />We just set an arbitrary limit and if we reached that number of recursive calls, just admit those items failed and notify as appropriate and return.Jonathan Qhttps://www.blogger.com/profile/10906913358498829740noreply@blogger.com