Store profile image of all users into single directory or per subdirectory id?
- by Luccas
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!