How Data Skew can kill the performance of your Salesforce Org (chapter 1)

Quality Clouds > Coding  > How Data Skew can kill the performance of your Salesforce Org (chapter 1)

How Data Skew can kill the performance of your Salesforce Org (chapter 1)

Audience: Salesforce architects and advanced administrators

Reading time: 6 min

Data skew can kill performance of your org

The majority of Salesforce customers will never suffer performance issues in their orgs. However, there are certain configuration patterns which appear again and again, because they are apparently “good ideas”, but which increase the probability of performance issues arising in our Org. These patterns cause inefficient data distributions at the storage layer, technically known as Data Skew. Data Skew problems and are so hard to anticipate and can have such a dramatic impact on performance that they are known by Salesforce as “the silent killer”.

Perhaps the most common of these patterns is when a single user owns more than 10,000 records of an object. This type of skew is called ownership data skew. In most cases, the customer will not notice any issue even when having this kind of a situation, but there is one particular situation in which the impact on performance of this kind of Data Skew can be very significant.

This situation arises when we have an org on which we assign a large number of leads or contacts to a single account, indicating that must be checked or validated, or for some other functional reason. etc. This looks like a convenient way of keeping related contacts together, but it can cause severe performance degradation when the roles of the owner of the account with all these records attached are modified. When this happens, whether it is a role addition deletion, or a move in the role hierarchy, the Salesforce platform needs to perform a number of recalculation of access rights in its internal data structures to ensure that access permissions are consistent with the new changes in the role hierarchy. These calculations must be performed in real time, and in order to perform them, Salesforce needs to block any update on the records affected. During the recalculations, there is no chance to modify the records involved until the calculation is finished. Significantly, a complex role hierarchy also impacts the amount of time which is necessary to complete these calculations.

So an apparently harmless decision to structure our contacts and leads in a specific way, coupled with a supposedly unrelated permission modification operation, can result in a large number of users experiencing severe performance issues. Furthermore, because these issues will seem to be automatically solved once Salesforce has completed its internal recalculations, it can be very difficult for the support team or admins to trace the root cause of the issue, which will then likely appear again on the next role modification. And with increased severity as the size of the data in our org grows.

Fine tune your org

A general rule of thumb which can help prevent these ownership data skew issues is to distribute the ownership of records across a greater number of users. This means that any access permission recalculation required by a role change will take an insignificant amount of time and thus not impact the performance of the org.

But how can we proactively know whether our org is already vulnerable to ownership data skew issues?

Quality Clouds for Salesforce performs automated scans of the configuration of your Org, including an analysis of the complexity of the Role Hierarchy. Any situation in which the Role Hierarchy of your Org is overly complex or customized, including the presence of unassigned roles, will be reported in a Quality Clouds scan, together with many more KPIs about Custom Objects, Reports, Apex components, etc. This information can then be used to ensure that any customizations stay under control, and to prevent issues like “the silent killer” from degrading the performance of your Org.

 

References:

Reducing Lock Contention by Avoiding Account Data Skew
Architect Salesforce Record Ownership Skew for Peak Performance in Large Data Volume Environments
docs.qualityclouds.com

Start your Quality Clouds trial

Leave your comments below 👇

Part 2 here