Salesforce Relationships as Toy Story Characters
Lookup vs Master-Detail vs Inherit vs External vs Hierarchy
There are a lot of relationships available to choose from in Salesforce. A lot. Studying them can be confusing, frustrating, and downright hard.

Wouldn't it be easier if they each had personalities of their own? If they were all characters of a well-known popular animated movie?
Lookup Relationship
(friendship/mentor) = loose relationship.

Features:
-
parent not required
-
no impact on security and access
-
child can live without parent
-
multiple layers deep
-
up to 40 parents
-
roll-up summary field not allowed.
Master-Detail relationship
Features:
-
Child object totally dependent on parent - will be deleted if the parent is, inherits sharing settings from parent.
-
Up to 3 layers deep
-
A standard object cannot be a child if the master is custom
-
Child can have 2 parents
-
Roll-up summary fields (display a value in a master record based on the values of fields in a detail record) totally okay.
-
Lookup field on page layout is required.
-
Create relationship on child
Bo Peep and her sheep are perfect examples of a Master Detail relationship. Bo Peep's sheep are completely reliant on Bo for everything. If she goes, they go. In the same way, detail relationships will go if their parent goes. Bo Peep also happens to have 3 sheep (or at least 3 sheep heads), and Master-Detail relationships can only go up to 3 layers deep. Handy. Bo Peep knows everything about her sheep including how many there are at any given time - almost like a roll-up field that displays a value on the master record based on the values in a detail record.
Indirect relationship
Features:
-
links a child external object to a parent standard or custom object.
Woody is the parent standard object, and Forky the strange child external object.
External relationship
Features:
-
links a child standard, custom, or external object to a parent external object.
If the claw machine is Salesforce, the aliens inside it are the child standard objects, and Buzz coming in from the outside is the parent external object.
Hierarchical relationship
Features:
-
A special lookup relationship available for only the user object.
-
For example, you can create a custom hierarchical relationship field to store each user's direct manager.
A Hierarchical relationship is best thought of a way to show the organisational structure within a company - how everyone relates to everyone else. In Toy Story (although everyone is 100% a team), there is a definite Hierarchical structure. Buzz and Woody lead at the top, and then there is the executive team; Mr and Mrs Potato Head, Jessie, Bullseye, Rex, Little Bo Peep; followed by the general staff; Slinky Dog,
Sarge and the Bucket O Soldiers, Lenny the binoculars, etc.