School of Information Systems

Fan Trap vs Chasm Trap

Fan traps arise when a model describes relationships between entity types, but the paths between occurrences of certain entities are ambiguous. This ambiguity can lead to incorrect or conflicting interpretations when querying the database. This often happens when there is redundancy in the relationships or when certain paths between entities create confusion.

Problem example:

Consider three entities: A, B, and C. There are two relationships: A to B (1:N) and B to C (N:1). Now, if there is another relationship from A to C (N:1), a fan trap may occur. When attempting to retrieve information about C starting from A, there are multiple paths (A to B to C and directly A to C). This can result in ambiguity, as the system may not know which path to follow.

The solution:

In the example above, creating an associative entity (let’s say AB) between A and B, and another between B and C, can resolve the ambiguity. The solution is to restructure the ER model to represent the correct relationship between entities to eliminate fan traps. Restructuring is done by repairing a relationship that exists in the entity so that it fits as it should. In the example we can justify the position of Staff – Division (ambiguous part) – Branch to Division – Branch – Staff.

Chasm trap

when a model suggests a relationship between one or more entity types but the path between certain occurrences is missing (missing). Chasm traps can occur where there are one or more relationships with a minimum multiplicity of zero that form part of the path between related entities. Similar to a fan trap, a chasm trap involves ambiguity in relationships, but it has a different manifestation. The chasm entity typically has at least two foreign keys pointing to other entities. The problem arises when a query involves these relationships, leading to ambiguous or misleading results.

Problem example:

Consider three entities: A, B, and C. There are two 1:N relationships: A to C and B to C. Both A and B have foreign keys pointing to C. If a query involves selecting information from A and B, it may create a chasm trap because there are multiple paths to reach C. This can lead to ambiguous results when retrieving data from C.

The solution:

The solution is to identify the missing relation in the ER model that makes it not have the relation that should exist and then add the relation that should exist to the ER model by assigning the relation to the ER model. This associative entity breaks the direct connection between A and C or B and C, providing a more structured and unambiguous relationship model. By introducing the associative entity, the relationships between A and C and B and C become N:M (many-to-many) relationships, resolving the chasm trap.

References:

Lily Javienka