Thursday, April 12, 2012

Delete Multiple Objects from s3

Deleting s3 objects used to be slow if you have lots of files in a s3 buckets: you have to issue a delete request for each file. On Dec 7, 2011 , Amazon announced Multi-Object Delete, a new API that allows user to delete multiple objects with a single web request.

As this api is relatively new, those popular ruby s3 libraries including rightaws has not supported it. So I wrote a ruby script to do it, the source code is here:
https://gist.github.com/2361625

And it can be used as a command line tool:

$ruby s3_multi_object_delete.rb bucket s3id s3key key1 key2

Or you want to use it in your Rails project, just drop it into 'config/initializers' folder.

It is based on happening, although the code can be ported to rightaws easily. I picked happening as it may archive better performance due to higher concurrency.

Labels:

Monday, April 09, 2012

HTML5 for Desktop Application Development