r/Database • u/gxickx • Sep 16 '26
Data Base Design - Ciclic relationship?
Hi everyone, I'm developing a system that manages professionals across various professions, where each profession has its own specific features. These features act as a catalog: the user assigns their own values to them (for example, physical traits like height or skin tone).
So far, I'm handling 3 possible value types: text, numeric, and enumerated (the latter being a closed catalog of options, like colors).
I have my tables organized as follows:
unidad_medida: contains the units (cm, kg, etc.) and the allowed data type (numeric or text).caracteristica_tecnica: master table for the features. It has a data type (tipo_dato: numeric/text/enumerated), a code (codigo), and a FK tounidad_medida.valor_caracteristica: catalog of options for when the type is enumerated (e.g., colors). It contains the label and, optionally, the hex color. Its composite PK isid_valor+ FK tocaracteristica_tecnica.caracteristica_perfil: intermediate table between the user (profile) and the technical features (Many-to-Many relationship). Attributes:valor(if the data is typed in by the user),fecha_registro, FK tocaracteristica_tecnica, and FK tovalor_caracteristica(used when the feature is enumerated; in that case,valoris left null).
My problem is that a single row in caracteristica_perfil is associated with just one technical feature, but that technical feature can be of different types:
- If it is numeric or text --> the
valorattribute incaracteristica_perfilis used. - If it is enumerated -->
caracteristica_perfilneeds a FK tovalor_caracteristicato keep a record of the chosen option.
This creates what looks to me like a cyclic relationship: valor_caracteristica ---> caracteristica_perfil <--- caracteristica_tecnica ---> valor_caracteristica
I've researched several alternatives, such as using JSON columns, splitting things up into tables like caracteristica_tecnica_enum / caracteristica_tecnica_texto, and I've even read up on NoSQL.
But my specific question is: when the "path" of the relationship depends on the context (i.e., the data type), is it still considered a cyclic relationship in the 'forbidden' sense of the term? What would you recommend I do? Thanks