Sobes.tech
Junior — Middle

What types of relationships between entities in a database would you consider undesirable for use in your projects and why?

sobes.tech AI

Answer from AI

Undesirable types of relationships between entities in a database depend on the context, but generally, the following should be avoided:

  • Cyclic relationships (cycles in relationships). They complicate data deletion and update logic and can lead to integrity issues.

  • Too tight "many-to-many" relationships without an explicit intermediate table. This complicates scaling and maintenance.

  • Relationships with cascade delete without strict control. They can lead to unintentional data loss.

  • Relationships with redundant denormalization, leading to data duplication and desynchronization.

  • **Relationships using nullable foreign keys without necessity, which complicates logic and can lead to errors.

In projects, it is better to design relationships to be as simple, understandable, and maintainable as possible, with clearly defined semantics and constraints.