Combating Data Skew in Salesforce: Avoiding Performance & Locking Issues

Описание к видео Combating Data Skew in Salesforce: Avoiding Performance & Locking Issues

Are you encountering failures when trying to bulk update child records tied to the same parent record? Is it taking forever when making ownership updates to objects? Data skew may be the culprit. Let's look at what data skew is as well as where it shows up in Salesforce. We'll explore best practices to help us escape the data skew trap.

Before we dive into the specifics of data skew, take a moment to subscribe to our channel, Salesforce Explorer. Twice a month, we dig into an interesting Salesforce topic to help expand your knowledge around what is possible in Salesforce.

What is Data Skew?
Assume we had an airplane half full, and all our passengers decided to sit in the back half of the plane. Do you think our plane would fly very efficiently? Would we even take off at all? Essentially, data skew is like our passengers on the plane. When we have an imbalanced distribution of data in Salesforce, problems occur. The problem relates to how objects are connected to one another. Say within our Salesforce org, we have a thousand account objects. Each of those accounts has a handful of contacts associated with them. So far so good. What if we have a bunch of contact records that don't easily pair with an existing account? We have to do something with these orphans, so we decide to gather these up and assign them to a new dummy account we've created called Unassigned. At first, that solution may get the job done, but over time that Unassigned account object will get weighed down as we pile thousands of child records on top of it. We'll start encountering locking and performance issues.

What is Happening?
When we perform bulk updates, a lock is placed on the parent and child object while that update processes. This is done to enforce data integrity. While this process is fast, there is a high risk of these updates colliding when we lock the same parent object over and over again. Not only that, but validation rules and automation can trigger these updates. This also comes into play when sharing permissions are adjusted. If we change the owner of the account, it now must examine all those related child records which force recalculation. What feels on the surface like minor updates can ultimately bring your performance to a crawl.

Best Practices
So how can we avoid data skew? First and foremost, avoid assigning 10k records or more to a single parent record. If you are forced to implement this less than ideal parking lot approach, utilize round robin logic to evenly distribute records across an array of dummy account objects. To avoid the sharing recalculations, don't assign generic system users a role or conversely provide them with a role at the top of the hierarchy. Lastly, clean up your data. The smaller the footprint, the easier it is for Salesforce to navigate.

Remember, Salesforce wasn't meant to operate as a data warehouse, housing millions of records. We have to be smart about how we approach data management in Salesforce. With a little preventative maintenance, you can sidestep data skew in your Salesforce environment.

If you need help with data management in Salesforce, consider reaching out to the company I work for – Improving. We have a lot of talented Salesforce architects to help you optimize and get the most out of your Salesforce environment. Please reach out to us at https://improving.com. We’d love to see how we can help.

Thank you for taking a few minutes to explore data skew in Salesforce with me today. If you found this video helpful, please take a minute to like and subscribe to our channel. We’ve got more Salesforce data-related topics queued up for the weeks ahead. Please come along and explore with us. Until then.

Videos provided courtesy of Mixkit

==Related Videos
PK Chunking: Fixing Salesforce Bulk API Timeouts:    • PK Chunking: Fixing Salesforce Bulk A...  
How Skinny Tables Can Help Boost Performance in Salesforce:    • How Skinny Tables Can Help Boost Perf...  
6 Tips & Tools to Improve Data Quality in Salesforce:    • 6 Tips & Tools to Improve Data Qualit...  

Комментарии

Информация по комментариям в разработке