K
K
Konstantin2018-10-15 15:59:45
Database design
Konstantin, 2018-10-15 15:59:45

What is the best way to store image information in a database?

Now there are two options:
1) Create a Photos table with a unique key and a path to the picture:

Photos
id | path

And put all the photos (reference) in this table.
Then the table of product photos and user photos will look like this:
ProductPhotos     UsersPhotos
id | photoId         id | photoId

As far as it will be correct, I mean the loading of the Photos table?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
R
Ruslan., 2018-10-15
@LaRN

They also used to store graphical information in the database, but they abandoned this idea, the database is growing too fast, plus the overhead for loading / unloading.
As a result, we store graphic information on the file server, and in the database only links to graphic information (i.e. a description of what we store and the path to the file)

I
Ivan Shumov, 2018-10-15
@inoise

normal solution. Just keep weight, loading date and other useful information

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question