[SalesForce] Maximum number of children allowed in a parent-to-child lookup relationship

Is there any limit on the number of children a parent can have in a lookup relationship? If there is no limit, Is there any good practice guideline with regards to the number of children added to a parent?

For example, Parent__c and Child__c are objects where Child__c.Parent__c is a lookup field.

Best Answer

There is a good practice guideline of 10,000 child records per parent.

The reason for this is that 10,000 is the point that Salesforce has established for describing a situation as having "data skew", a condition where the inherent locking and sharing mechanisms of the platform start to break down by causing increased incidence of row locking errors and degraded performance. Specifically, the situation you're asking about would be called "parent-child data skew" if more than 10,000 child objects existed on a parent record.

It's not a hard and fast thing. It's possible to have more than 10,000 children on a single parent with no negative outcomes. However, that setup massively increases the likelihood of encountering specific classes of problems - row locking errors with significant add and update operations, or sharing-related performance impact (depending on the specific sharing defaults and rules involved).

See Designing Record Access for Enterprise Scale for more, as well as Managing Lookup Skew in Salesforce to Avoid Record Lock Exceptions, or search SFSE or other Salesforce forums for "data skew" for lots of discussion.

Related Topic