T
T
truelogin2017-12-22 21:36:42
Database design
truelogin, 2017-12-22 21:36:42

Tree-like data storage or "normalized" in the AU?

Good afternoon!

Comrades, we ask you to help us solve one dilemma.
We develop/have an AS in which tasks are carried out and tasks are set for employees.
At the moment we have a table with tasks and a separate table with the stages of these tasks.

Now the developers are proposing to switch to a different model - store stages and tasks in one table (arrange trees).

My humble opinion (analyst) is that it is right to leave the model that currently exists, because it allows you to quickly find the necessary stages through an ordinary JOIN by id. Allows you to save some space.

Who faced both approaches - what are the pros, what are the cons?
Are there examples to look at?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
kn0ckn0ck, 2018-01-08
@kn0ckn0ck

The question is not very simple.
1. Place different data in one table - this is about denormalization and has nothing to do with trees. Denormalization can create a lot of problems, including a lot of logical errors.
2. If you want to store trees with arcs of arbitrary length, then using a single table is the easiest, but most inefficient way to work with hierarchies.
3. Depending on the type of DBMS, there may be built-in capabilities for working with hierarchical data; they impose requirements on the data storage format. This is the most correct way to organize the storage of hierarchies.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question