-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
File Storage #1
Comments
Actually this a good point. So what people tend to do is not store files in databases. The standard pattern here is like you're thinking to hash the content and store that content hash in the db. The data itself ("often referred to as a blob") goes into a blob storage facility. In your case maybe that is google drive. Especially if you're thinking that people can write the letters in any format they want. For the MVP it might make sense for you to just return a url that links to the underlying data, and display the metadata. On Blob Storage: If you have the resources available, it might be better to https://devcenter.heroku.com/articles/s3-upload-node . It'll give you more flexibility and probably be a better storage system for your needs. The other thing to note is that you might consider using a CDN like cloudfront with S3. It will help with the retrieval of the data, but is tricker to set up. So I'd start with the foundational layer which is the s3 bucket, on public for the proof of concept (against best practices - setting the bucket to public). As a first pass I would not complicate things and simply use s3 and heroku. You'll get better performance because heroku is deployed on aws to start, and will do a better job of colocating your data. In theory it'll be cheaper as well, because you won't pay outgoing network bandwidth. the rest of this might be tl;dr :D and just background information on uploading data schemes. I believe for the 1.x these are not necessary so that's why there's the tl;dr caveat :) .. So with file uploading schemes there are a few things to consider.
For the mvp and for the initial builds I would keep it simple, and just return an s3 url or a cloud front url that maps to s3. |
Storing files in the PostgreSQL database I imagine would require me to do some sort of buffering to account for the possibility of large files. Is there a recommended strategy for dealing with file storage?
What are everyone's thoughts on simply storing the file through a Google Drive cloud service for the moment and rather than hashing the entire file contents in our database we just store a hashed file id?
Also for reference here is my current database schema for the MVP:
The text was updated successfully, but these errors were encountered: