Why is it so much slower to delete objects in AWS S3 than it is to create them?


I have an AWS lambda function that watches an S3 bucket. When an image is uploaded to the bucket the lambda function creates a thumbnail of the image. However I made a mistake in the function and saved the transformed file in the same directory that was being watched, creating an infinite loop.

It ran for roughly a minute before I stopped it, and in that time created 600,000 images. However, deleting those images (using the AWS console) took about 20 minutes.

Why such a difference? I’m interested in the low-level reasons for this.


According to this documentation https://docs.aws.amazon.com/AmazonS3/latest/dev/delete-or-empty-bucket.html deletion is an “insertion of a deletion marker”. So it might explain why a deletion is so slow compared to an upload which provides only an eventual consistency.

Leave a Reply