I have a situation where I need to store binary data in an Oracle database as blob columns. There are three different tables in my database wherein I need to store a blob data for each record. Not every record will necessarily have the blob data all the time. It is dependent on time and user.
- Table One will store *.doc files for almost each record.
- Table Two will store the *.xml optionally.
- Table Three will store images (frequency unknown)
Is this a good approach of maintaining a separate table to store the various blob data pointing it to the respective table PK's? (Yes, there will be no FKs, I'm assuming the program will maintain it). It will be some thing like below,
BLOB|PK_ID|TABLE_NAME
Alternatively, is it a good idea to keep the blob columns in separate tables?
As far as my application runtime is concerned,
Table 2 will be read very frequently. Though the blob column will not be required.
Table 2's records will be deleted frequently.
The other blob data in respective tables will not be accessed frequently. All of the blob content will be read on an as-needed basis.
I'm thinking first approach will work better for me. Any concerns on this design in terms of performance or maintainability?