Reputation: 5056
I have a REST API and I'm using S3 to store images .zip files, and other media like video. Is it common practice to use a single bucket for everything? Or divide buckets by file type?
For example, here are some of the kinds of content I have:
.jpg
.png
.zip
.mov
.maya
.obj
Upvotes: 1
Views: 213
Reputation: 171
You can store all your files in a single bucket without a problem. If you wish to have more separation, keys in S3 are composite similar to URLs. For example you can have:
<your_bucket_name>/images/<key1>.png
<your_bucket_name>/images/<key2>.jpg
<your_bucket_name>/videos/<key3>.mp4
This will keep all your files in a single bucket, but in the AWS console they will be split similar to a file system - inside folders. Note that in order to access the resource stored in S3 you will need to use the full path e.g /images/key1.png
Upvotes: 2
Reputation: 269312
A single Amazon S3 bucket can contain any number of objects.
Reasons for using separate buckets are typically:
There is no reason to use a different bucket for different file types, unless those file types are used for different purposes (like the above).
Upvotes: 4