R
R
REDkiy2018-03-06 23:57:51
Database design
REDkiy, 2018-03-06 23:57:51

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

3 answer(s)
S
sim3x, 2018-03-07
@REDkiy

Start by learning 3NF
EAV
Denormalization
Afterwards, learn how best to use json in these situations

A
asd111, 2018-03-07
@asd111

Try mongodb. Good for goods.

Y
Yerlan Ibraev, 2018-03-07
@mad_nazgul

Productive Option 1
Viable Option 2
:-)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question