3 ms·
Checksums: I'd want to verify the data integrity, especially if it's to be stored for a long time and retrieved in the distant future. So I'd compute at least
by epc 5y ago
Checksums: I'd want to verify the data integrity, especially if it's to be stored for a long time and retrieved in the distant future. So I'd compute at least some sort of SHA sum (I personally use SHA512 but I'm doing it on files in an archive that I rarely retrieve). Possibly a short fast CRC would suffice.
I'd store the CRC/hash plus whatever metadata you need to track (account uploading, IP address, filename, etc,) in the database plus whatever pointer you need to locate it in your cloud storage service(s).
I wouldn't store the files in the database unless you're going to be using something from the database service on the files (are you indexing them for search, for example?).
I'd also sketch out the realistic use to find the potential breaking points. When we did the image storage system for the 1996 Olympic web site we thought we were so, so smart for how we sliced up the filenames and directory structure, only to learn that the underlying DFS we were using was doing its own very sophisticated file slicing and dicing resulting in suboptimal performance. We would have been much better off dumping all of the files into date/time directories and leaving it at that.
|Or do what neximo64 suggests in https://news.ycombinator.com/item?id=27778952 https://news.ycombinator.com/item?id=27778952
- herodoturtle 5y agoThanks for the detailed insight and advice. That all makes perfect sense. We will do as you and neximo64 suggest. You've both been a great help, cheers.