Using a new S3 bucket for a new user?
I want to开发者_如何学Python create an application where users can upload their documents and use Amazon's S3. Is it OK to create a new bucket per user so that he/she will only have access to his/her file or is there a better solution? I'm doing the project using PHP. Thanks!
One Amazon S3 account is limited up to the 100 buckets. If you plan to have more than 100 clients, this is not a good idea to create new bucket for each customer.
Another approach used in similar cases is to store all user's data in one single bucket, and separate user's data using unique prefix, for example:
user_id_1/file1
user_id_1/folder1/file2
user_id_2/file1
user_id_2/folder1/file2
...
user_id_n/file1
user_id_n/folder1/file2
but you will need to implement access control on your side to protect users' data.
精彩评论