Store profile image of all users into single directory or per subdirectory id?

Posted by Luccas on Server Fault See other posts from Server Fault or by Luccas
Published on 2012-09-04T16:11:37Z Indexed on 2012/09/10 21:40 UTC
Read the original article Hit count: 239

I'm using amazon s3 as storage for users profile pic. I see that many websites generates large random filenames and put them into the same root directory like:

http://xxx.us-east-1.amazonaws.com/aHR0cHM6Ly9mYmNkbi1wcm9maWxlLWEuYWthbWFpaGQubmV0L2hwcm9maWxlLWFrLWFzaDIvMjczMzkxXzEwMDAwMDMxMjAxMzg5OV81NTk3MjM4Mzdfbi5qcGc.jpg

And my question is: What are the pros and cons of that approach?

If I palce them into different directories, what problems I will have in future?

http://xxx.us-east-1.amazonaws.com/users/id/username.jpg

or

http://xxx.us-east-1.amazonaws.com/users/id/random_number.jpg

Thanks!

© Server Fault or respective owner

Related posts about amazon-web-services

Related posts about amazon-s3