Reputation: 307
Right now I am migrating to Amazon S3 from standard server. In current server, I have to set structure of directories in order to stay more efficient. For example, current structure of directory is: category_id/article_id/year/month/day/article_image.jpg and so on.
So, do I need to create such structure in the bucket of Amazon S3. Does it affect speed of requests?
Upvotes: 1
Views: 318
Reputation: 111
Here is a quote from faq
Q: How is Amazon S3 data organized? Amazon S3 is a simple key-based object store. When you store data, you assign a unique object key that can later be used to retrieve the data. Keys can be any string, and can be constructed to mimic hierarchical attributes.
So, really neither the length of path is important, nor structure of directories.
Upvotes: 1
Reputation: 8099
This depends a lot on your needs. The path itself is not important for S3, but you may prefer to find all images used in a specific category, on a specific date etc. So I would approach this from your management side, not from the performance side.
That said, if you have a lot of requests (like more than 50 requests per second), you might think of another way to organize your folder structure. Here is a posting on the AWS blog that gives some examples to get the best performance out of S3.
Upvotes: 1