Reputation: 5079
I am creating a web app for some co-working. I have text with assets (most of them pictures in print quality, say 5MB, all in all about 5GB per month).
I am going to host this on amazon's cloud using EC2 instances for a node.js server and a mongodb with attached block storage.
The assets are private to an object so not everyone will have access to it.
How should i handle the assets? Save them as binarys in the database or load them up to S3? (or any other amazon service)
Does somebody have experience on this? Or maybe some helpful links. Thanks in advance
Upvotes: 1
Views: 172
Reputation: 648
I would probably store the assets on S3 without public access, then you can grant access to authorized users by generating temporal signed urls from your webservers when needed. This way you can leverage your servers complexity by handing over the storage dirty work to S3, and you can still have your files accessed only by who has access to them.
Upvotes: 1
Reputation: 361
If you need to do access control there are lots of things you could do but the most obvious would be to server the asserts through your web server and have it implement the access control logic desired. Your app could proxy through the source object from S3 or MongoDB GridFS. If you are already using MongoDB, in this particular case I would use GridFS unless you want some of the cost saving features of S3 such as reduced redundancy storage.
Upvotes: 1