4

I'm making the tables for an application, and I need many tables with images.

Instead of storing the BLOBS on each table, I'm thinking on storing all the images (BLOB) on a single table, to unify the processing of all images with a small set of routines.

I'm not asking if I should store the images on a table made only for images. I'm asking if I should use a single table for all the images, or multiple tables holding images. (For example, one tables for images of employees, and other for images of cars).

I'm inclined to use a single table for all images. But I have zero experience with databases, and I don't know if it is a good idea. Maybe it breaks normal forms rules?

timix
  • 61

1 Answers1

3

The single table approach sounds reasonable. Keeping them all over the database in different tables may become difficult to manage, and you may end up with a lot of duplicate code that does basically the same thing, just against different tables.

(That said, if you have a large number of images, say > 10,000, I'd certainly consider both a single table to track the images, and keeping the images themselves in the file system. This way you are not using the database connection to handle the transfer of the images)

GrandmasterB
  • 39,412