D
D
Dmitry2017-04-06 14:28:37
Online shopping
Dmitry, 2017-04-06 14:28:37

Photo storage structure for an online store with 32K products?

The point is in the title.
32K goods.
About 50 categories.
There is a variant to add categories:
images\products\{id_category}\{id_product}\ here photos
But if the product is in different categories?
It feels like a solution has already been found.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
Vasya Petrov, 2017-04-06
@VasyaPertrov

But if the product is in different categories?

Physically, the picture is located in one directory, and the category is a virtual and non-permanent entity. The links "product-category" and "product-path to the image" are records in the database. As you can see, the category and physical location are not directly related in any way, but only through the product. Which is also just a data set in the database.
For example, in the VP, a decision was made to scatter by date (year / month). But it can be done according to other criteria. For IM, the solution with the name of the directories by the names of the categories is quite acceptable.

E
Egor Ommonik, 2017-04-06
@Ommonick

The link to the pictures is stored in the database directly comparable to the product, the pictures themselves are stupidly stored in the same folder. This approach, if I'm not mistaken, will also be useful for security. (Flenov wrote about this in his book.)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question