Use Case

What are the use cases for creating a one-to-one relationship where the parent points to the child compared to a child pointing to the parent? If there is no difference, is one preferred over the other?


+---------+     +-------+       +--------+     +----------+
+ Parent  +     + Child +       + Parent +     + Child    +
+---------+     +-------+  vs.  +--------+     +----------+
+ idChild + --> + id    +       + id     + <-- + idParent +
+---------+     +-------+       +--------+     +----------+

I suspect that you'd choose between these relationships depending on which entity is used first in the application. i.e. If the parent object always appears before the child object, then the relationship should be mapped from the parent to child.

  • Please explain down vote. It will help me structure questions better.
    – Pete
    Mar 20, 2014 at 15:52

3 Answers 3


It can effect the representation of your structure if you marshal it to XML or JSON. For example, do you want "parent" to be the top element or object, or do you want "child" to be the top element or object?

A lot of times it depends on how the application uses the data. If the primary users of a system are children, it may be more convenient to represent child -> parent because you're doing the lookup starting with the child ID.


In terms of database design is quite more logical to have the child store the relationship back to the parent. Primarily, because keeping the information for each child in the parent's is inflexible (assuming you use fields for child's IDs), like in your first example, since you cannot dynamically allocate more than a single reference to a child.

  • Is there a use case where it is better for the parent would point to the child?
    – Pete
    Mar 20, 2014 at 16:16
  • 1
    If you talking outside of database design, then yes. There are some scenarios where the parent needs to control or manage children without their explicit consent or knowledge. However, this is something that can be implemented in your domain or business logic without affecting you underlying database design.
    – rae1
    Mar 20, 2014 at 16:44

I was working on a software project with one-to-one relationships, in our project was the child pointing on the parent, because it just is more logical, that the child shows its parent and not other way round.

  • Is it because a parent may or may not have a child? Whereas a child must have a parent, so it's more optimal to model the child pointing to its parent.
    – Pete
    Mar 20, 2014 at 15:41
  • Yeah sth like that
    – Knerd
    Mar 20, 2014 at 15:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.