I have an application which will have approximately 25,000 records when the initial data import is complete. These records will each have 1-3 associated ‘file attachments’ (.doc, .pdf, etc). Can anyone give me advice on how to implement this functionality? Specifically, where would you store the files and how would you organize them?
I am reluctant to store them directly in the database, as this would result in a huge database. Does this seem like a valid concern? If so, I don’t think I would want to see up to 100,000 files in a single folder either.
I’d make a decision base on what you want to do with them afterwards.
The sizes aren’t really a concern, and neither are the counts. NTFS maxes out at 2^32 file entries, so 100k isn’t going to sweat it. And SQL overhead will add little to the 200GB worth of data, so it’s not likely that space will be a deciding factor.
The same arguments as we always have over whether you should store in the DB (locking, indexable/queryable attributes, ACID, DB security, known backup/recovery, etc.) versus the filesystem (simpler, slightly smaller, well known, can move to external storage easily, etc.) are going to be the deciding factor.