mongodb - Proper way to organize images for many users in rackspace cloudfiles for Node.js app? -


I have a simple node. JS apps will be my user profiles and each user can upload multiple images. Rackspace will be uploaded to cloudfile.

I am currently using the module.

The way it works currently:

I pass a file test that uploads it to the Rackspace cloudfile, and gives the CDN URL to that image ( The name of the image is racked by the racket) (URL looks like this):

The racket now saves all the images in one container.

Here are my questions:
1) Should I secure images of each user in a separate container (for privacy, security and to ensure that That no user can delete another user)?

2) Will it be enough to just submit the URL ref in the database and reference it in the future? Can not I make any changes to this URL?

3) Does it mean more to predict user's image with user name or hash, which is related to images given to a given user?

The best practice approach?

Thank you

I was sent to this great article that in fact my Very good answer to the questions:

To sum articles for my use case:

1) Use multiple containers One container Having too many images makes you slow, especially since you can write in a single container, but there is a throttle, it can be particularly problematic. The 2 users are trying to upload images for the same container. Therefore a separate container for each user is understood here.

2) You can use pseudo-folder for organization if necessary You can name your image (this rackspace is an object in the cloud) "/ User123 / ducks / duck_small.jpg "The name of the image in this scenario is that the whole string (including the slash)

3) Store reference for images in your database . To access the cloud files to list container contents, it is simply too slow to get the CDN URL for the image from your database.

Comments