OBLYTECH Logo
OBLYTECH Logo

Master-Detail or Lookup: A Data Model Decision Guide

Choose master-detail when a child record has no meaning without its parent, and the parent should decide who can see the child and whether it can be deleted. Choose a lookup when the child has its own owner and access rules and can exist without the parent. Answer the ownership and deletion questions first, since they decide the type.

Start with who is accountable for the child record

A practical way into this decision is to ask who answers for a child record day to day. If the team that manages the parent also edits, reviews and retires the children, the children are part of the parent’s story. A purchase order and its line items are a typical case. The line items rarely mean much apart from the order, and the people who approve the order expect to control them.

Now take a different case. A contact may be linked to several accounts, maintained by sales and support teams that do not report to each other, and keep its value after any one account closes. Those facts point toward a lookup. The child has its own accountable teams, and tying it to one parent would ask a single team to decide things that belong to several.

Write the answer for each child object as a short list before any build work starts. Name the team, the approver for changes, and the person who may remove a record. If you cannot name one accountable team, lean toward a lookup rather than a master-detail relationship.

Decide what should happen when the parent is removed

Deletion is the decision that teams tend to underweight. Ask what a child record means after its parent leaves the system. If the children should go too, they are components of the parent, and a master-detail design matches that business rule. If a child should survive with its history intact, so it stays searchable for audit, a lookup protects it.

Retirement needs a separate question. Many organizations close accounts or projects by changing a status rather than removing the record. In that setup, deletion may not come up at all, and the real question becomes whether a retired parent should still control who sees its children. Confirm the retirement practice with the people who run data retention before settling the relationship type.

Deletion also shapes reporting. Children that disappear with their parent leave gaps in historical reports, while children that survive keep their totals. Test the reports your managers read against a sample of parents removed in a sandbox before you commit to a design.

Map sharing and access before you choose the type

Sharing is the second test. A master-detail design generally ties who can see a child to who can see its parent. The exact result depends on your configuration, so confirm it in your own environment before relying on it.

Start by listing the people who should see each child without seeing its parent. In many programs this group is larger than expected. Finance may need invoice lines, a regional team may need detail rows for its own accounts, and an auditor may need read-only access across all of them. Each group that needs independent access pushes the design toward a lookup, because the parent cannot act as the sole gate.

Then list the people who see the parent and must also see all of its children. If that group closely matches the parent group, the master-detail pattern fits. If the two groups diverge, you are designing around exceptions, and exceptions are where access mistakes tend to happen.

Run this decision sequence with the data owners

Work through the sequence with the people who own the business process, not only the admin team. The answers should come from the business, and the admin team turns them into a design.

  1. Name the parent and the child. Write the relationship as a plain sentence, such as “an order line belongs to one order.” If the sentence needs several qualifiers, rewrite it until the relationship is clear.
  2. Ask who is accountable for the child. Record one team and one approver. If two teams share the child and neither will give ground, favor a lookup.
  3. Ask what happens to the child when the parent is removed. Ask the data owner for a concrete example from the last quarter, not a general principle.
  4. List the groups that need the children without the parent. Include finance, reporting, support and audit. Each group with independent access is a reason to avoid master-detail.
  5. Check the totals and reports that depend on the relationship. Pick three reports that managers use each month and confirm they still make sense under the chosen type.
  6. Record the decision and the reason. Write one paragraph for the design file, with the team that agreed and the date. Reopen the record when the business process changes.

For help planning this work, see Salesforce implementation.

Signs that a lookup is the better fit

Lookups suit children that have a life of their own. Four patterns point toward a lookup:

  • The child is shared across more than one parent, such as a contact who works with several accounts.
  • The child follows its own approval or review cycle, separate from the parent’s.
  • The child arrives from a source system before its parent has been confirmed.
  • Reports need the child’s totals even when the parent is inactive or removed.

The migration case needs its own note. When child records come from a legacy system, the load order and the parent matching decide whether the relationship can be set on the way in. Plan the load sequence before you choose a type. For the wider project, start with data migration and integration. For the load method itself, compare the options in choosing data loader options for migration.

Checks to run before you build the relationship

Run the checks on paper first, then test a small sample before anything reaches production data.

Paper checks

  • Confirm each child has one accountable team and one approver.
  • Confirm the deletion rule with a named data owner.
  • Confirm the list of groups that need independent access.
  • Confirm the totals and reports with their current readers.

Sample test

Load a small set of parents and children that reflect your hardest cases, such as a child shared by two teams and a parent that is retired. Ask each group to sign off on what they see. Problems surface quickly this way, and a correction on paper costs far less than a correction to production data.

Duplicate children can surface during the sample test. For the ongoing side of that work, see the data steward duplicate review routine. If the children need cleanup before they are loaded, start with the wider Salesforce data quality and migration area.

Questions about choosing between master-detail and lookup

What if children must stay visible to people who cannot see the parent?

That requirement is the strongest signal for a lookup. Map the group first, then check whether that group needs to see the parent at all. If it does not, a lookup lets the children carry their own access without exposing the parent. Test with a real user from that group, because a spreadsheet of who should see what does not show what each person can actually open.

Can the relationship type change after the data exists?

It can be changed, but the change is rarely simple. Each existing child needs a plan for how its link will be set, and the parents need to be matched first. Treat the change as a data project with a backup, a trial run and a way back, rather than a configuration edit. The cost of changing course grows with data volume, which is why the first choice deserves the extra time.

Who should sign off on the relationship decision?

The data owner for the child should sign off on the deletion and visibility answers. The process owner for the parent should sign off on the accountability answer. The admin or architect records the decision and checks it against the design. If one of these sign-offs is missing, the decision is not finished, even when the build is ready.

Does the choice change what reports show?

It can. Reports that group children under parents assume the parent still exists, and reports that count children on their own assume those children stay in place. Run the three reports managers read each month and compare the totals before and after the change. A difference you cannot explain means the relationship has not been fully mapped.

What should a team do when the answers point in different directions?

Record both answers and weigh the deletion answer more heavily. A child that is wrongly removed usually costs more to restore than a child that needs an extra sharing step. Escalate the conflict to the data owner rather than letting the build team pick. A short written decision with the reasoning will save a second round of debate later.