Answer the question
In order to leave comments, you need to log in
How to properly organize the data structure for a website in Python + MySQL?
how to properly organize the data structure for a website in Python + MySQL?
given: industrial product. The factory designation of the product has the following structure ABC-XXXX-XXXX-XXXX, where the first three letters "ABC" are the same for all products. And the remaining letters display properties/attributes of the product that are not related to each other and can take 1...8 values.
For example, the first "X" is a color, it can take on the values 1-white, 2-red, 3-green, 4-yellow, etc.
the second "X" is the adhesive with which the product is bonded, can be 1-polyurethane-based adhesive, 2-epoxy-based adhesive, 3-ceramic-based adhesive, etc.
the third "X" is the material from which the product is made, it can take the values 1-polyamide, 2-galvanized steel, 3-aluminum,
etc.
That is, the product can be called ABC-9871-5235-1258 and in the same spirit in accordance with the attributes possible for a given x.
tasks following
how to properly organize the data storage structure?
The first option, the most stupid and inefficient, is to create a table and fill it with all possible product designation options. The result is a table with 20.000 - 100.000 entries for all possible product combinations.
There are two aspects to consider
1. generating a sitemap.xml for the search engine. When a search engine asks for a sitemap.xml file - to generate this file for it based on this large table - everything is clear here. And without her?
2. The visitor enters the product name in the search box on the website. Search based on this large table - everything is clear here. And without her?
I suspect that it is possible to organize the data somehow more efficiently than a static table of 20.000 - 100.000 records, but I do not understand how.
Please support the idea.
If you do not make this large table, and when the sitemap.xml is requested by the search engine, dynamically generated from individual attributes, the process will probably take from 5 minutes or more. Will the search engine wait that long?
Answer the question
In order to leave comments, you need to log in
in short came to the following decision.
if we take all possible options, then we get the number of entries in the order table with 6 zeros. Which, in principle, is clearly redundant from all points of view. I settled on the fact that I will create about 100,000 thousand records that will cover at least 80 percent (and maybe more) of all possible search queries. That's where it stopped. That is, I will have about 100,000 links in my sitemap.xml.
These 100,000 records with the product designation could be dynamically generated from two tables with 50 records - saving space in the table (probably not necessary) but resource-intensive with each new generation. Therefore, I made one static table for these 100,000 entries, from which sitemap.xml is automatically generated in a couple of seconds.
.
That is, the original perfectionist approach turned out to be clearly redundant.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question