We have learned about various features of Salesforce data model in our previous blogs. One of the major aspects of Salesforce’s data modelling is object relationships—the way different objects in Salesforce are linked to each other. Among the various relationship types, Master-Detail and Lookup relationship is the most commonly used. To design an optimal Salesforce data model, it is crucial to understand how these two differ. Let’s explore each relationship type in detail.
Master-Detail Relationship
- In Salesforce, a Master-Detail relationship is a tightly coupled relationship between two objects. One object acts as the Master, and the other acts as the Detail (Child). The child record is highly dependent on the master record. eg: Campaign and Campaign Member. A campaign is the master, and each contact involved in the campaign is a member (detail).
Features of Master-Detail Relationship
- Cascade Delete: If a master record is deleted, all associated child records gets deleted automatically.
- Ownership & Security: The child record inherits the owner, sharing settings, and security from the master record.
- Roll-Up Summary Fields: You can create roll-up summary fields on the master object to aggregate values (SUM, COUNT, AVG, MIN, MAX) from related child records.
- Required Field: The child record must always be associated with a master record; it cannot exist independently.
- Reparenting Control: Depending on settings, a child record may or may not be reparented to another master record.
Lookup Relationship
A Lookup relationship is a loosely coupled relationship where one object has a link to another object. But unlike the master-detail relataionship, the child record is independent of the parent record.eg: Contact and Account, here a contact can exist independently even if the associated account is deleted. So a contact can be linked to multiple accounts if needed.
Features of Lookup Relationship
- Independent Records: Deleting a parent record does not delete the child records.
- Ownership & Security: The child record does not inherit the security settings of the parent.
- No Roll-Up Summary Fields: Roll-up summary fields are not available.
- Optional Relationship: The child record can exist without a parent record.
- Lookup Filters: Admins can define criteria to restrict which parent records can be selected.
Keep in mind the following considerations when deciding between Master-Detail and Lookup relationships
- If a child record must always have a parent and needs security inheritance -Master-Detail.
- If child records should remain even if the parent is deleted-Use Lookup.
- If you need roll-up summary fields to calculate aggregate values-Use Master-Detail.
- If the relationship is optional and more flexible- Use Lookup.
To learn more about Master-Detail and Lookup Relationships in Salesforce, click Object Relationships Overview




