Answer the question
In order to leave comments, you need to log in
What is more productive - many tables or complex relationships?
The task was to make a catalog of parts:
- There can be many types of parts.
- Each type of part consists of a different number of surfaces (which forms their type), which differ in geometric dimensions.
So far I think like this:
Option 1:
I make a plate for each type of part, with a different number of columns and keep a list of them at hand. I see one advantage so far, fairly simple queries.
Cons: Hundreds of tables.
Option 2:
I make the following tables:
- Part types.
- Types of surfaces.
- Parameter.
- Parameters of types of details.
Accordingly, in the table "Parameters of types of parts" links to other tables and directly the value of the parameter.
Pros: Only 4 tables.
Cons: Complex queries. Parameter value of only one type (may require conversion). One huge table.
The question is - Which option is more productive and viable in these conditions?
Answer the question
In order to leave comments, you need to log in
Start by learning 3NF
EAV
Denormalization
Afterwards, learn how best to use json in these situations
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question