Do I need to use randomized hashes as a prefix to object key names in my Amazon S3 bucket?

Last updated: 2019-12-19

To optimize performance, do I need to use randomized hashes as a prefix to object key names in my Amazon Simple Storage Service (Amazon S3) bucket? 

Resolution

No, you're not required to randomize the prefixes of the S3 objects in your S3 bucket with hashed characters to optimize performance. Performance guidelines for frequent data retrievals had previously recommended randomizing prefixes with hashed characters, but that's no longer necessary. For example, you no longer need to use hashed characters in prefixes like in the following object keys:

awsexamplebucket/232a-2013-26-05-15-00-00/photo1.jpg
awsexamplebucket/7b54-2013-26-05-15-00-00/photo2.jpg

Instead, you can use sequential, date-based naming:

awsexamplebucket/2013-26-05-15-00-00/photo1.jpg
awsexamplebucket/2013-26-05-15-00-00/photo2.jpg

You can send at least 3,500 PUT/COPY/POST/DELETE and 5,500 GET/HEAD requests per second per prefix in a bucket. There's no limit to the number of prefixes that you can have in a bucket. For more information, see Best Practices Design Patterns: Optimizing Amazon S3 Performance.


Did this article help you?

Anything we could improve?


Need more help?