brazil-data-cube / bdc-catalog

Brazil Data Cube Image Metadata Catalog
https://bdc-catalog.readthedocs.io/en/latest/
GNU General Public License v3.0
4 stars 10 forks source link

Suggestion: create an N:N relationship between `items` and` collections` #141

Closed rmmariano closed 3 years ago

rmmariano commented 3 years ago

In the current BDC model, we only have an items table that contains the scene information and its assets.

In the context of the DGI catalog, a scene can be in several collections at the same time, due to the levels of processing (e.g. L2, L4, DN, SR, etc.), in other words, the information of a same scene will be repeated in 2 or more records within items.

Given that we deal with thousands of scenes, if there is a need to edit the information of a scene, all repetitions will have to be changed, which may not be the ideal for a relational database.

For example: in the current DGI database, there is one table with scenes (Scene), one with collections (Dataset) and another with assets (Asset). The relationship would be 1:N (Scene:Asset) and N:1 (Asset:Dataset), that is, Assets is an N:N relationship between scene information (Scene) and collections (Dataset).

Maybe create this N:N relationship between items andcollections could be a good practice or create another way to avoid data redundancy.

Thank you in advance.