SlideShare a Scribd company logo
SAIMA
Salesforce Architects In The Making
Agenda
1. Welcome & Introduction
2. Implicit Sharing
3. Skews and Record Locking
4. Summary
Who We Are
Johann Furmann
Technical Product
Manager Salesforce
jfuermann@gmail.com
Nora Nicklis
Freelance Salesforce
Trainer & Consultant
nora@nicklis.de
What We Want To Achieve
We want to support each other in preparing for the Technical
Architect certification by:
● Creating and sharing content that helps to prepare for
the certification
● Facilitating small study groups to make room for
discussion based learning
If you have more ideas on what we could/should do, please
let us know!
Housekeeping Rules
● Post your questions in the chat, we will answer them
during or after the session
● We are not perfect, neither do we know everything. If
you spot a mistake, please do let us know!
● Interested in presenting? Please reach out to us,
everybody is welcome to present!
Session 1
Implicit Sharing
Johann Furmann
SAIMA Group
17.04.2020
@fliack
Kind of
Sure
Agenda
• Parent
• Child
• Portal
• Case
• Share Groups (High Volume)
20 April 2020Johann Furmann 2
Parent
Definition
Read-only access to the parent account for a user with access to a child
record
• Not used when sharing on the child is controlled by its parent
• Expensive to maintain with many account children
• When a user loses access to a child, Salesforce needs to check all other
children to see if it can delete the implicit parent.
20 April 2020Johann Furmann 3
Parent
Explanation
• Only affects Account to Case, Contact and Opportunity
• Account = private AND Child != “Controlled by Parent”
As soon as a User has at least Read access to a Case, Contact or
Opportunity the User has Read access to the related Account.
20 April 2020Johann Furmann 4
Kind of
Sure
Parent
Demo
Demo User: Carla Sunflower (Salesforce License)
OWD Private: Account, Contact, Case, Opportunity
1. Carla Sunflower no access to any Accounts, Cases, Contacts or
Opportunities
2. Man. Share a Contact with Carla Sunflower
-> Carla Sunflower gets Read access to Account
20 April 2020Johann Furmann 5
Child
Definition
Access to child records for the owner of the parent account
• Not used when sharing on the child is controlled by its parent
• Controlled by child access settings for the account owner’s role
• Supports account sharing rules that grant child record access
• Supports account team access based on team settings
• When a user loses access to the parent, Salesforce needs to remove all
the implicit children for that user.
20 April 2020Johann Furmann 6
Child
Explanation
• Only affects Account to Case, Contact and Opportunity
• Only affects Account Owner
Each role independently can define what Child-Record access the Account
Ownership provides.
20 April 2020Johann Furmann 7
Child
Demo
Demo User: Carla Sunflower (Role: Eastern Sales Team)
OWD Private: Account, Contact, Case, Opportunity
1. Set Carla Sunflower as Account Owner
-> Carla Sunflower gets Edit Access to all Opportunities
2. Setting “Opportunity Access” is “Cannot access” for Role
-> Carla can not Access the Opportunity anymore
20 April 2020Johann Furmann 8
Portal
Definition
Access to portal account and all associated contacts for all portal users
under that account.
Shared to the lowest role under the portal account
20 April 2020Johann Furmann 9
Portal
Explanation
• Only Partner Community License
• Only affects Contacts which were enabled for Partner Community
A Partner-Community User has read access to her Account and all other
Contacts on that Account.
20 April 2020Johann Furmann 10
Portal
Demo
Demo Contact: Mia Learnsalot
OWD Private: Account & Contact
1. Log-In to community
-> Her Account and other Contacts visible
20 April 2020Johann Furmann 11
Case Access
Definition
Case access—If a portal or customer community plus user is a contact on a
case, then the user has Read and Write access on the case.
20 April 2020Johann Furmann 12
Case Access
Explanation
The Contact for a Case has Read & Edit Access on that Case.
• Only affects Partner and Community Plus Licenses
• Community License Users need Sharing-Set
20 April 2020Johann Furmann 13
Kind of
Sure
Case Access
Demo
Demo Contact / Customer: Mia Learnsalot
OWD Private: Account, Contact and Case
1. Mia sees no Cases
2. Create a Case for Mia
3. Add Mia as the Contact to the Case
-> Mia can see and edit the Case
20 April 2020Johann Furmann 14
Share Group (High Volume)
Definition
Access to data owned by high volume users associated
with a sharing set for users member of the sharing set's
access group.
All members of the sharing set access group gain
access to every record owned by every high volume
user associated with that sharing set.
20 April 2020Johann Furmann 15
Share Group (High Volume)
Explanation
Profile: Customer Community
• Record Ownership by User is necessary
• Affects (almost?) all Objects
• Record Owner needs profile in Share Set
• Any Record owned by a Profile mentioned in the Share Set is shared with
any user mentioned in the related Share Group
20 April 2020Johann Furmann 16
Kind of
Sure
Share Group (High Volume)
Demo
High Volume Community User AND Carla Sunflower
1. Create share set for Custom Demo Object and Community Profile
2. Share Group add Carla Sunflower
3. High Volume Community User creates Case Record
-> Record is shared to Carla Sunflower too
20 April 2020Johann Furmann 17
Implicit Sharing
Johann Furmann
SAIMA Group
17.04.2020
@fliack
Sources
Built-in Sharing Behavior
https://help.salesforce.com/articleView?id=sharing_across_objects.htm&typ
e=5
Implicit Sharing
https://developer.salesforce.com/docs/atlas.en-
us.draes.meta/draes/draes_object_relationships_implicit_sharing.htm
20 April 2020Johann Furmann 19
Session 2
© Nora Nicklis, 2020
Salesforce -
Record Locks & Skews
by Nora Nicklis
© Nora Nicklis, 2020
Record Locks
© Nora Nicklis, 2020
Types of Record Locks
● business-related
→ defined by business process and implemented intentionally (e.g. approval
process, read-only record types)
● system-related
→ done by Salesforce, available and implemented out of the box (cannot be
changed)
Record Locks can happen
© Nora Nicklis, 2020
UNABLE_TO_LOCK_ROW, unable to obtain exclusive access to
this record
Error
© Nora Nicklis, 2020
System Related Record Locks
Quality of a database is often measured by its data integrity:
● Data accuracy
● Data completeness
● Data consistency
One measure by Salesforce (and many other databases) to maintain data integrity
is to place record locks on records (and their parent records) while they are being
edited.
© Nora Nicklis, 2020
System Related Record Locks - Example (II)
ABC LabsABC Labs
Billing City Berlin
1.
Billing City Sydney
2.
Save3.Save4.
5.
© Nora Nicklis, 2020
System Related Record Locks - Example (I)
ID Account Rating
0013z00002Q4zFbAAJ ABC Labs A
ID Account Rating
0013z00002Q4zFbAAJ ABC Labs B
ID Account Rating
0013z00002Q4zFbAAJ ABC Labs C
Data Load Integration
Automation /
Apex
❗ A given transaction can only wait a maximum of 10 seconds for a lock to be released, otherwise it will
throw and UNABLE_TO_LOCK_ROW exception
© Nora Nicklis, 2020
Skews
© Nora Nicklis, 2020
skew
ADJECTIVE
Neither parallel nor at right angles to a specified or implied line;
askew; crooked.
© Nora Nicklis, 2020
Data Skews
In a database, a skew refers to a situation in which there is an uneven distribution
of data.
© Nora Nicklis, 2020
Data Skews
In a database, a skew refers to a situation in which there is an uneven distribution
of data.
© Nora Nicklis, 2020
Data Skews
In a database, a skew refers to a situation in which there is an uneven distribution
of data.
© Nora Nicklis, 2020
Data Skews in Salesforce
In Salesforce, data skews happen when records relate to one another and child
records are unevenly distributed across the parent records. They will typically
result in performance issues.
There are three kinds of data skews that can occur:
● Account Skew
● Ownership Skew
● Lookup Skew
© Nora Nicklis, 2020
Lookup Skew - Overview
Lookup Skews happen in object relationships when a large number of child
records are associated to one parent record.
When a child record is inserted or updated, Salesforce locks the parent record the
child will be associated to in order to maintain data integrity. When you work with
large data, and there are processes (e.g. custom code, automated processes,
integrations) you can easily run into lock contention.
❗ Lookup skews happen in lookup relationships AND master-detail relationships
(Locks only occur on lookup relationship if it is not configured to clear the value of this field if the lookup record is deleted)
❗ Lookup skews can effect standard AND custom objects
© Nora Nicklis, 2020
Lookup Skew - Example
Rank__c
Player__c
- Scout
- Explorer
- Mountaineer
1.000.000 Players,
each will be
assigned a rank
Result
→ Each rank will have approx.
333.333 child player records
→ Potential lock issues when
loading/updating player information
© Nora Nicklis, 2020
How to Identify a Lookup Skew
There is no exact identifier by which you will be able to identify a lookup skew.
Don’t wait until somebody complains, try to address to problem right away.
Take a look at the following.
● Objects with a lot of records
● Objects where a lot of inserts and updates happening in parallel
● Objects where you get complaints about locks from users
© Nora Nicklis, 2020
How to Handle Lookup Skews
Whenever possible, try to avoid Lookup Skews!
If it is not possible to avoid an Lookup Skew, look at the following strategies to
soothe them:
● Reducing Record Save Time (Apex Best Practices, Asynchronous processing,
Consolidate Automation)
● Picklist fields
● Distributing the skew (Add records on parent, Default = Blank, Review need,)
● Reducing the load (Serial loading, Order by parent ID and chunk the data
carefully)
© Nora Nicklis, 2020
Account Skew - Overview
An Account Skew arises, when a large number of child records (>10.000) are
related to a single account.
There are two main problems that can be caused by an Account Skew:
● Record Locking
● Sharing Problems
© Nora Nicklis, 2020
Account Skew - Sharing Problems
Sharing problems arise because of Salesforce built in parent implicit sharing.
(Users with access to to contacts, cases and opportunities get read access to the related account)
If sharing of a child record of a certain object is updated, Salesforce will have to
check all other children of that object to check, if the implicit share for the Account
can be removed.
● Depending on the amount of children, the recalculation can take long and will
cause performance issues
● During the whole operation, a lock is placed on the account preventing other from
editing it
© Nora Nicklis, 2020
Account Skew - Example
Dummy
Account
Owner: Matt
1.
Lara Smith
Owner: Nora
2.
Joey Young
Owner: Sarah
...
...
Owner: ...
23 456.
Carlos Rodriguez
Owner: Yin
23 457.
Fumiko Suzuki
Owner: Nora
© Nora Nicklis, 2020
Account Skew - Example
Dummy
Account
Owner: Matt
1.
Lara Smith
Owner: Camilla
2.
Joey Young
Owner: Sarah
...
...
Owner: ...
23 456.
Carlos Rodriguez
Owner: Yin
23 457.
Fumiko Suzuki
Owner: Nora
© Nora Nicklis, 2020
How to Handle Account Skews
Whenever possible, try to avoid Account Skews!
To do so, try to follow these suggestions:
● Limit the amount of Account children per object to 10.000.
● If you need generic Accounts, create a pool of accounts and use a round robin
algorithm to distribute them
● Consider setting the Account OWD to “Public Read/Write” (the record locking will
stay, but sharing calculations won’t happen)
● Redistribute existing child object records during off hours (Batch Apex, Bulk API)
© Nora Nicklis, 2020
Ownership Skew - Overview
An ownership skew happens, if a single user owns more than 10.000 records of
one object.
Performance issues caused by an ownership skew will most typically appear in
large organisation where data changes that require sharing recalculation happen
frequently. These changes could happen on:
● Ownership based sharing rules
● Record ownerships
● Group members / Role Hierarchy
© Nora Nicklis, 2020
Ownership Skew - Example
Joey Young
Owner: Sam
Sales
Contact ID User/Group Row Cause
0033z00002fpwsYAAQ Sam Sales Owner
Contact ID Owner Name
0033z00002fpwsYAAQ Sam Sales Joey Young
User Groups
Camilla Chief * CEO
Sally Sales * VP Sales
Sam Sales Sales Rep
CEO
VP
Sales
VP
Finance
Account
ant
Sales
Rep
Sally Sales
Sam Sales
Fred Finance
Anna
Accountant
Camilla Chief
* implicit sharing
Contacts Table
Contact Sharing Table
Group Maintenance Table
© Nora Nicklis, 2020
Ownership Skew - Example
Joey Young
Owner: Sam
Sales
Contact ID User/Group Row Cause
0033z00002fpwsYAAQ Sam Sales Owner
Contact ID Owner Name
0033z00002fpwsYAAQ Sam Sales Joey Young
User Groups
Camilla Chief * CEO
Sally Sales * VP Sales
Sam Sales VP Finance
CEO
VP
Sales
VP
Finance
Account
ant
Sales
Rep
Sally Sales
Sebastian
Sales
Sam Sales
Anna
Accountant
Camilla Chief
* implicit sharing
Contacts Table
Contact Sharing Table
Group Maintenance Table
© Nora Nicklis, 2020
Reasons for Ownership Skews
Common reasons for ownership skews:
● The System Administrator is a fallback/default owner during automation
processes/data migration
● Usage of a dummy user (for unassigned records, for records created through
integrations)
© Nora Nicklis, 2020
How to Handle Ownership Skews
Whenever possible, try to avoid Ownership Skews!
If it is not possible to avoid an Owernship Skew, try to follow these suggestions:
● Ensure that the “skewed” owner is not part of the role hierarchy or put them in a
role at the top of the hierarchy/within its own branch
● Don’t move the user into another role / move the role within the role hierarchy
● Keep the user out of public groups used for sharing
● For organization wide sharing, review OWDs (is private necessary?)
● Consider granting access on profile level or using criteria based sharing rules for
sharing with a group of users
© Nora Nicklis, 2020
Summary
Whenever possible, try to avoid Skews!
If not, don’t worry!
Identify them early and apply strategies learned to soothe/handle them.
© Nora Nicklis, 2020
Sources
● https://developer.salesforce.com/blogs/engineering/2013/04/managing-lookup-skew-to-avoid-record-lock-exceptions.html
● https://developer.salesforce.com/blogs/engineering/2012/04/avoid-account-data-skew-for-peak-performance.html
● https://resources.docs.salesforce.com/sfdc/pdf/salesforce_record_access_under_the_hood.pdf
● https://developer.salesforce.com/blogs/engineering/2012/06/architect-salesforce-record-ownership-skew-for-peak-performance-
in-large-data-volume-environments.html
Summary
● Slides & Recording will be shared after the meeting (Slides →
Linkedin, Recording → Youtube)
● Unanswered questions will be answered in the upcoming days in the
comments of the video
● We will keep you posted on the topics and the date for the next
session
(if your are interested in being a presenter next time, please reach out)

More Related Content

What's hot

Best Practices with Apex in 2022.pdf
Best Practices with Apex in 2022.pdfBest Practices with Apex in 2022.pdf
Best Practices with Apex in 2022.pdf
Mohith Shrivastava
 
Getting started with Salesforce security
Getting started with Salesforce securityGetting started with Salesforce security
Getting started with Salesforce security
Salesforce Admins
 
Maximizing Salesforce Lightning Experience and Lightning Component Performance
Maximizing Salesforce Lightning Experience and Lightning Component PerformanceMaximizing Salesforce Lightning Experience and Lightning Component Performance
Maximizing Salesforce Lightning Experience and Lightning Component Performance
Salesforce Developers
 
Choosing the Right Demo Environment (Salesforce Partners)
Choosing the Right Demo Environment (Salesforce Partners)Choosing the Right Demo Environment (Salesforce Partners)
Choosing the Right Demo Environment (Salesforce Partners)
Salesforce Partners
 
Introduction to apex code
Introduction to apex codeIntroduction to apex code
Introduction to apex code
EdwinOstos
 
Integrating with salesforce
Integrating with salesforceIntegrating with salesforce
Integrating with salesforce
Mark Adcock
 
Introduction to the Salesforce Security Model
Introduction to the Salesforce Security ModelIntroduction to the Salesforce Security Model
Introduction to the Salesforce Security Model
Salesforce Developers
 
Deep dive into Salesforce Connected App
Deep dive into Salesforce Connected AppDeep dive into Salesforce Connected App
Deep dive into Salesforce Connected App
Dhanik Sahni
 
Salesforce sharing and visibility Part 1
Salesforce sharing and visibility Part 1Salesforce sharing and visibility Part 1
Salesforce sharing and visibility Part 1
Ahmed Keshk
 
Lwc presentation
Lwc presentationLwc presentation
Lwc presentation
Nithesh N
 
Understanding the Salesforce Architecture: How We Do the Magic We Do
Understanding the Salesforce Architecture: How We Do the Magic We DoUnderstanding the Salesforce Architecture: How We Do the Magic We Do
Understanding the Salesforce Architecture: How We Do the Magic We Do
Salesforce Developers
 
Salesforce Sharing Architecture
Salesforce Sharing ArchitectureSalesforce Sharing Architecture
Salesforce Sharing Architecture
gemziebeth
 
Secure Salesforce: External App Integrations
Secure Salesforce: External App IntegrationsSecure Salesforce: External App Integrations
Secure Salesforce: External App Integrations
Salesforce Developers
 
From Sandbox To Production: An Introduction to Salesforce Release Management
From Sandbox To Production: An Introduction to Salesforce Release ManagementFrom Sandbox To Production: An Introduction to Salesforce Release Management
From Sandbox To Production: An Introduction to Salesforce Release Management
Salesforce Developers
 
Apex code (Salesforce)
Apex code (Salesforce)Apex code (Salesforce)
Apex code (Salesforce)
Mohammed Safwat Abu Kwaik
 
Salesforce Integration Patterns
Salesforce Integration PatternsSalesforce Integration Patterns
Salesforce Integration Patterns
usolutions
 
Relationships in Salesforce
Relationships in SalesforceRelationships in Salesforce
Relationships in Salesforce
MST Solutions LLC
 
Salesforce integration best practices columbus meetup
Salesforce integration best practices   columbus meetupSalesforce integration best practices   columbus meetup
Salesforce integration best practices columbus meetup
MuleSoft Meetup
 
Record sharing model in salesforce
Record sharing model in salesforceRecord sharing model in salesforce
Record sharing model in salesforce
Sunil kumar
 
Why Flow with Salesforce Flow
Why Flow with Salesforce FlowWhy Flow with Salesforce Flow
Why Flow with Salesforce Flow
Ajeet Singh
 

What's hot (20)

Best Practices with Apex in 2022.pdf
Best Practices with Apex in 2022.pdfBest Practices with Apex in 2022.pdf
Best Practices with Apex in 2022.pdf
 
Getting started with Salesforce security
Getting started with Salesforce securityGetting started with Salesforce security
Getting started with Salesforce security
 
Maximizing Salesforce Lightning Experience and Lightning Component Performance
Maximizing Salesforce Lightning Experience and Lightning Component PerformanceMaximizing Salesforce Lightning Experience and Lightning Component Performance
Maximizing Salesforce Lightning Experience and Lightning Component Performance
 
Choosing the Right Demo Environment (Salesforce Partners)
Choosing the Right Demo Environment (Salesforce Partners)Choosing the Right Demo Environment (Salesforce Partners)
Choosing the Right Demo Environment (Salesforce Partners)
 
Introduction to apex code
Introduction to apex codeIntroduction to apex code
Introduction to apex code
 
Integrating with salesforce
Integrating with salesforceIntegrating with salesforce
Integrating with salesforce
 
Introduction to the Salesforce Security Model
Introduction to the Salesforce Security ModelIntroduction to the Salesforce Security Model
Introduction to the Salesforce Security Model
 
Deep dive into Salesforce Connected App
Deep dive into Salesforce Connected AppDeep dive into Salesforce Connected App
Deep dive into Salesforce Connected App
 
Salesforce sharing and visibility Part 1
Salesforce sharing and visibility Part 1Salesforce sharing and visibility Part 1
Salesforce sharing and visibility Part 1
 
Lwc presentation
Lwc presentationLwc presentation
Lwc presentation
 
Understanding the Salesforce Architecture: How We Do the Magic We Do
Understanding the Salesforce Architecture: How We Do the Magic We DoUnderstanding the Salesforce Architecture: How We Do the Magic We Do
Understanding the Salesforce Architecture: How We Do the Magic We Do
 
Salesforce Sharing Architecture
Salesforce Sharing ArchitectureSalesforce Sharing Architecture
Salesforce Sharing Architecture
 
Secure Salesforce: External App Integrations
Secure Salesforce: External App IntegrationsSecure Salesforce: External App Integrations
Secure Salesforce: External App Integrations
 
From Sandbox To Production: An Introduction to Salesforce Release Management
From Sandbox To Production: An Introduction to Salesforce Release ManagementFrom Sandbox To Production: An Introduction to Salesforce Release Management
From Sandbox To Production: An Introduction to Salesforce Release Management
 
Apex code (Salesforce)
Apex code (Salesforce)Apex code (Salesforce)
Apex code (Salesforce)
 
Salesforce Integration Patterns
Salesforce Integration PatternsSalesforce Integration Patterns
Salesforce Integration Patterns
 
Relationships in Salesforce
Relationships in SalesforceRelationships in Salesforce
Relationships in Salesforce
 
Salesforce integration best practices columbus meetup
Salesforce integration best practices   columbus meetupSalesforce integration best practices   columbus meetup
Salesforce integration best practices columbus meetup
 
Record sharing model in salesforce
Record sharing model in salesforceRecord sharing model in salesforce
Record sharing model in salesforce
 
Why Flow with Salesforce Flow
Why Flow with Salesforce FlowWhy Flow with Salesforce Flow
Why Flow with Salesforce Flow
 

Similar to Salesforce - Implicit Sharing, Record Locks & Skews

Orlando SFDC User Group 10/2011
Orlando SFDC User Group 10/2011Orlando SFDC User Group 10/2011
Orlando SFDC User Group 10/2011
Joshua Hoskins
 
2020 06-24 fireside chat implicit sharing
2020 06-24 fireside chat implicit sharing2020 06-24 fireside chat implicit sharing
2020 06-24 fireside chat implicit sharing
Jihun Jung
 
Orlando SFDC User Group 6/2010
Orlando SFDC User Group 6/2010Orlando SFDC User Group 6/2010
Orlando SFDC User Group 6/2010
Joshua Hoskins
 
SplunkLive! Paris 2018: Intro to Security Analytics Methods
SplunkLive! Paris 2018: Intro to Security Analytics MethodsSplunkLive! Paris 2018: Intro to Security Analytics Methods
SplunkLive! Paris 2018: Intro to Security Analytics Methods
Splunk
 
Act! Tips by Tech Benders
Act! Tips by Tech BendersAct! Tips by Tech Benders
Act! Tips by Tech Benders
Tech Benders
 
Salesforce automation hour - Rollup Summary Fields with Lookups - Meighan Bro...
Salesforce automation hour - Rollup Summary Fields with Lookups - Meighan Bro...Salesforce automation hour - Rollup Summary Fields with Lookups - Meighan Bro...
Salesforce automation hour - Rollup Summary Fields with Lookups - Meighan Bro...
Meighan Brodkey
 
The Demise of Duplicate Data Webinar (Part 1)
The Demise of Duplicate Data Webinar (Part 1)The Demise of Duplicate Data Webinar (Part 1)
The Demise of Duplicate Data Webinar (Part 1)
Cloudingo
 
Essay On My Best Teacher In School
Essay On My Best Teacher In SchoolEssay On My Best Teacher In School
Essay On My Best Teacher In School
Janet Katarezzy
 
Social Media and Financial Services presentation to Financial Planners Associ...
Social Media and Financial Services presentation to Financial Planners Associ...Social Media and Financial Services presentation to Financial Planners Associ...
Social Media and Financial Services presentation to Financial Planners Associ...
SocMediaFin - Joyce Sullivan
 
Where security and privacy meet partnering tips for CSOs and privacy/complian...
Where security and privacy meet partnering tips for CSOs and privacy/complian...Where security and privacy meet partnering tips for CSOs and privacy/complian...
Where security and privacy meet partnering tips for CSOs and privacy/complian...
Compliancy Group
 
2014 ota databreach3
2014 ota databreach32014 ota databreach3
2014 ota databreach3
Meg Weber
 
Lightning Connect: Lessons Learned
Lightning Connect: Lessons LearnedLightning Connect: Lessons Learned
Lightning Connect: Lessons Learned
Salesforce Developers
 
Presentation Build Your First App by Trailhead
Presentation Build Your First App by TrailheadPresentation Build Your First App by Trailhead
Presentation Build Your First App by Trailhead
Om Prakash
 
Lightning Connect: Lessons Learned
Lightning Connect: Lessons LearnedLightning Connect: Lessons Learned
Lightning Connect: Lessons Learned
Sumit Sarkar
 
Dreamforce 13 Optimizing Data Sync for Mobile Apps
Dreamforce 13 Optimizing Data Sync for Mobile AppsDreamforce 13 Optimizing Data Sync for Mobile Apps
Dreamforce 13 Optimizing Data Sync for Mobile Apps
Teodoro Alonso
 
Consistent flexibility - Creating and Managing your Desktop Workflows
Consistent flexibility - Creating and Managing your Desktop WorkflowsConsistent flexibility - Creating and Managing your Desktop Workflows
Consistent flexibility - Creating and Managing your Desktop Workflows
Ipro Tech
 
How to assess your it needs and implement technology at your nonprofit
How to assess your it needs and implement technology at your nonprofitHow to assess your it needs and implement technology at your nonprofit
How to assess your it needs and implement technology at your nonprofit
TechSoup Canada
 
2020 Barcelona Administrators Group - Virtual Event Dec 15
2020 Barcelona Administrators Group - Virtual Event Dec 152020 Barcelona Administrators Group - Virtual Event Dec 15
2020 Barcelona Administrators Group - Virtual Event Dec 15
animuscrm
 
Topic Tech companies prepare for cyber-attacks using common cyber.docx
Topic Tech companies prepare for cyber-attacks using common cyber.docxTopic Tech companies prepare for cyber-attacks using common cyber.docx
Topic Tech companies prepare for cyber-attacks using common cyber.docx
juliennehar
 
Salesforce1 Mobile Tips & Tricks for Admins
Salesforce1 Mobile Tips & Tricks for AdminsSalesforce1 Mobile Tips & Tricks for Admins
Salesforce1 Mobile Tips & Tricks for Admins
Salesforce Developers
 

Similar to Salesforce - Implicit Sharing, Record Locks & Skews (20)

Orlando SFDC User Group 10/2011
Orlando SFDC User Group 10/2011Orlando SFDC User Group 10/2011
Orlando SFDC User Group 10/2011
 
2020 06-24 fireside chat implicit sharing
2020 06-24 fireside chat implicit sharing2020 06-24 fireside chat implicit sharing
2020 06-24 fireside chat implicit sharing
 
Orlando SFDC User Group 6/2010
Orlando SFDC User Group 6/2010Orlando SFDC User Group 6/2010
Orlando SFDC User Group 6/2010
 
SplunkLive! Paris 2018: Intro to Security Analytics Methods
SplunkLive! Paris 2018: Intro to Security Analytics MethodsSplunkLive! Paris 2018: Intro to Security Analytics Methods
SplunkLive! Paris 2018: Intro to Security Analytics Methods
 
Act! Tips by Tech Benders
Act! Tips by Tech BendersAct! Tips by Tech Benders
Act! Tips by Tech Benders
 
Salesforce automation hour - Rollup Summary Fields with Lookups - Meighan Bro...
Salesforce automation hour - Rollup Summary Fields with Lookups - Meighan Bro...Salesforce automation hour - Rollup Summary Fields with Lookups - Meighan Bro...
Salesforce automation hour - Rollup Summary Fields with Lookups - Meighan Bro...
 
The Demise of Duplicate Data Webinar (Part 1)
The Demise of Duplicate Data Webinar (Part 1)The Demise of Duplicate Data Webinar (Part 1)
The Demise of Duplicate Data Webinar (Part 1)
 
Essay On My Best Teacher In School
Essay On My Best Teacher In SchoolEssay On My Best Teacher In School
Essay On My Best Teacher In School
 
Social Media and Financial Services presentation to Financial Planners Associ...
Social Media and Financial Services presentation to Financial Planners Associ...Social Media and Financial Services presentation to Financial Planners Associ...
Social Media and Financial Services presentation to Financial Planners Associ...
 
Where security and privacy meet partnering tips for CSOs and privacy/complian...
Where security and privacy meet partnering tips for CSOs and privacy/complian...Where security and privacy meet partnering tips for CSOs and privacy/complian...
Where security and privacy meet partnering tips for CSOs and privacy/complian...
 
2014 ota databreach3
2014 ota databreach32014 ota databreach3
2014 ota databreach3
 
Lightning Connect: Lessons Learned
Lightning Connect: Lessons LearnedLightning Connect: Lessons Learned
Lightning Connect: Lessons Learned
 
Presentation Build Your First App by Trailhead
Presentation Build Your First App by TrailheadPresentation Build Your First App by Trailhead
Presentation Build Your First App by Trailhead
 
Lightning Connect: Lessons Learned
Lightning Connect: Lessons LearnedLightning Connect: Lessons Learned
Lightning Connect: Lessons Learned
 
Dreamforce 13 Optimizing Data Sync for Mobile Apps
Dreamforce 13 Optimizing Data Sync for Mobile AppsDreamforce 13 Optimizing Data Sync for Mobile Apps
Dreamforce 13 Optimizing Data Sync for Mobile Apps
 
Consistent flexibility - Creating and Managing your Desktop Workflows
Consistent flexibility - Creating and Managing your Desktop WorkflowsConsistent flexibility - Creating and Managing your Desktop Workflows
Consistent flexibility - Creating and Managing your Desktop Workflows
 
How to assess your it needs and implement technology at your nonprofit
How to assess your it needs and implement technology at your nonprofitHow to assess your it needs and implement technology at your nonprofit
How to assess your it needs and implement technology at your nonprofit
 
2020 Barcelona Administrators Group - Virtual Event Dec 15
2020 Barcelona Administrators Group - Virtual Event Dec 152020 Barcelona Administrators Group - Virtual Event Dec 15
2020 Barcelona Administrators Group - Virtual Event Dec 15
 
Topic Tech companies prepare for cyber-attacks using common cyber.docx
Topic Tech companies prepare for cyber-attacks using common cyber.docxTopic Tech companies prepare for cyber-attacks using common cyber.docx
Topic Tech companies prepare for cyber-attacks using common cyber.docx
 
Salesforce1 Mobile Tips & Tricks for Admins
Salesforce1 Mobile Tips & Tricks for AdminsSalesforce1 Mobile Tips & Tricks for Admins
Salesforce1 Mobile Tips & Tricks for Admins
 

Recently uploaded

Programming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup SlidesProgramming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup Slides
Zilliz
 
Fueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte WebinarFueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte Webinar
Zilliz
 
Mariano G Tinti - Decoding SpaceX
Mariano G Tinti - Decoding SpaceXMariano G Tinti - Decoding SpaceX
Mariano G Tinti - Decoding SpaceX
Mariano Tinti
 
Energy Efficient Video Encoding for Cloud and Edge Computing Instances
Energy Efficient Video Encoding for Cloud and Edge Computing InstancesEnergy Efficient Video Encoding for Cloud and Edge Computing Instances
Energy Efficient Video Encoding for Cloud and Edge Computing Instances
Alpen-Adria-Universität
 
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
saastr
 
Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024
Jason Packer
 
Skybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoptionSkybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoption
Tatiana Kojar
 
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdfHow to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
Chart Kalyan
 
5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides
DanBrown980551
 
OpenID AuthZEN Interop Read Out - Authorization
OpenID AuthZEN Interop Read Out - AuthorizationOpenID AuthZEN Interop Read Out - Authorization
OpenID AuthZEN Interop Read Out - Authorization
David Brossard
 
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success StoryDriving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Safe Software
 
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfUnlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Malak Abu Hammad
 
UI5 Controls simplified - UI5con2024 presentation
UI5 Controls simplified - UI5con2024 presentationUI5 Controls simplified - UI5con2024 presentation
UI5 Controls simplified - UI5con2024 presentation
Wouter Lemaire
 
GenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizationsGenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizations
kumardaparthi1024
 
Best 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERPBest 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERP
Pixlogix Infotech
 
National Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practicesNational Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practices
Quotidiano Piemontese
 
Choosing The Best AWS Service For Your Website + API.pptx
Choosing The Best AWS Service For Your Website + API.pptxChoosing The Best AWS Service For Your Website + API.pptx
Choosing The Best AWS Service For Your Website + API.pptx
Brandon Minnick, MBA
 
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Speck&Tech
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
Octavian Nadolu
 
Nordic Marketo Engage User Group_June 13_ 2024.pptx
Nordic Marketo Engage User Group_June 13_ 2024.pptxNordic Marketo Engage User Group_June 13_ 2024.pptx
Nordic Marketo Engage User Group_June 13_ 2024.pptx
MichaelKnudsen27
 

Recently uploaded (20)

Programming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup SlidesProgramming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup Slides
 
Fueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte WebinarFueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte Webinar
 
Mariano G Tinti - Decoding SpaceX
Mariano G Tinti - Decoding SpaceXMariano G Tinti - Decoding SpaceX
Mariano G Tinti - Decoding SpaceX
 
Energy Efficient Video Encoding for Cloud and Edge Computing Instances
Energy Efficient Video Encoding for Cloud and Edge Computing InstancesEnergy Efficient Video Encoding for Cloud and Edge Computing Instances
Energy Efficient Video Encoding for Cloud and Edge Computing Instances
 
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
 
Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024
 
Skybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoptionSkybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoption
 
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdfHow to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
 
5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides
 
OpenID AuthZEN Interop Read Out - Authorization
OpenID AuthZEN Interop Read Out - AuthorizationOpenID AuthZEN Interop Read Out - Authorization
OpenID AuthZEN Interop Read Out - Authorization
 
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success StoryDriving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success Story
 
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfUnlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
 
UI5 Controls simplified - UI5con2024 presentation
UI5 Controls simplified - UI5con2024 presentationUI5 Controls simplified - UI5con2024 presentation
UI5 Controls simplified - UI5con2024 presentation
 
GenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizationsGenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizations
 
Best 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERPBest 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERP
 
National Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practicesNational Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practices
 
Choosing The Best AWS Service For Your Website + API.pptx
Choosing The Best AWS Service For Your Website + API.pptxChoosing The Best AWS Service For Your Website + API.pptx
Choosing The Best AWS Service For Your Website + API.pptx
 
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
 
Nordic Marketo Engage User Group_June 13_ 2024.pptx
Nordic Marketo Engage User Group_June 13_ 2024.pptxNordic Marketo Engage User Group_June 13_ 2024.pptx
Nordic Marketo Engage User Group_June 13_ 2024.pptx
 

Salesforce - Implicit Sharing, Record Locks & Skews

  • 2. Agenda 1. Welcome & Introduction 2. Implicit Sharing 3. Skews and Record Locking 4. Summary
  • 3. Who We Are Johann Furmann Technical Product Manager Salesforce jfuermann@gmail.com Nora Nicklis Freelance Salesforce Trainer & Consultant nora@nicklis.de
  • 4. What We Want To Achieve We want to support each other in preparing for the Technical Architect certification by: ● Creating and sharing content that helps to prepare for the certification ● Facilitating small study groups to make room for discussion based learning If you have more ideas on what we could/should do, please let us know!
  • 5. Housekeeping Rules ● Post your questions in the chat, we will answer them during or after the session ● We are not perfect, neither do we know everything. If you spot a mistake, please do let us know! ● Interested in presenting? Please reach out to us, everybody is welcome to present!
  • 7. Implicit Sharing Johann Furmann SAIMA Group 17.04.2020 @fliack Kind of Sure
  • 8. Agenda • Parent • Child • Portal • Case • Share Groups (High Volume) 20 April 2020Johann Furmann 2
  • 9. Parent Definition Read-only access to the parent account for a user with access to a child record • Not used when sharing on the child is controlled by its parent • Expensive to maintain with many account children • When a user loses access to a child, Salesforce needs to check all other children to see if it can delete the implicit parent. 20 April 2020Johann Furmann 3
  • 10. Parent Explanation • Only affects Account to Case, Contact and Opportunity • Account = private AND Child != “Controlled by Parent” As soon as a User has at least Read access to a Case, Contact or Opportunity the User has Read access to the related Account. 20 April 2020Johann Furmann 4 Kind of Sure
  • 11. Parent Demo Demo User: Carla Sunflower (Salesforce License) OWD Private: Account, Contact, Case, Opportunity 1. Carla Sunflower no access to any Accounts, Cases, Contacts or Opportunities 2. Man. Share a Contact with Carla Sunflower -> Carla Sunflower gets Read access to Account 20 April 2020Johann Furmann 5
  • 12. Child Definition Access to child records for the owner of the parent account • Not used when sharing on the child is controlled by its parent • Controlled by child access settings for the account owner’s role • Supports account sharing rules that grant child record access • Supports account team access based on team settings • When a user loses access to the parent, Salesforce needs to remove all the implicit children for that user. 20 April 2020Johann Furmann 6
  • 13. Child Explanation • Only affects Account to Case, Contact and Opportunity • Only affects Account Owner Each role independently can define what Child-Record access the Account Ownership provides. 20 April 2020Johann Furmann 7
  • 14. Child Demo Demo User: Carla Sunflower (Role: Eastern Sales Team) OWD Private: Account, Contact, Case, Opportunity 1. Set Carla Sunflower as Account Owner -> Carla Sunflower gets Edit Access to all Opportunities 2. Setting “Opportunity Access” is “Cannot access” for Role -> Carla can not Access the Opportunity anymore 20 April 2020Johann Furmann 8
  • 15. Portal Definition Access to portal account and all associated contacts for all portal users under that account. Shared to the lowest role under the portal account 20 April 2020Johann Furmann 9
  • 16. Portal Explanation • Only Partner Community License • Only affects Contacts which were enabled for Partner Community A Partner-Community User has read access to her Account and all other Contacts on that Account. 20 April 2020Johann Furmann 10
  • 17. Portal Demo Demo Contact: Mia Learnsalot OWD Private: Account & Contact 1. Log-In to community -> Her Account and other Contacts visible 20 April 2020Johann Furmann 11
  • 18. Case Access Definition Case access—If a portal or customer community plus user is a contact on a case, then the user has Read and Write access on the case. 20 April 2020Johann Furmann 12
  • 19. Case Access Explanation The Contact for a Case has Read & Edit Access on that Case. • Only affects Partner and Community Plus Licenses • Community License Users need Sharing-Set 20 April 2020Johann Furmann 13 Kind of Sure
  • 20. Case Access Demo Demo Contact / Customer: Mia Learnsalot OWD Private: Account, Contact and Case 1. Mia sees no Cases 2. Create a Case for Mia 3. Add Mia as the Contact to the Case -> Mia can see and edit the Case 20 April 2020Johann Furmann 14
  • 21. Share Group (High Volume) Definition Access to data owned by high volume users associated with a sharing set for users member of the sharing set's access group. All members of the sharing set access group gain access to every record owned by every high volume user associated with that sharing set. 20 April 2020Johann Furmann 15
  • 22. Share Group (High Volume) Explanation Profile: Customer Community • Record Ownership by User is necessary • Affects (almost?) all Objects • Record Owner needs profile in Share Set • Any Record owned by a Profile mentioned in the Share Set is shared with any user mentioned in the related Share Group 20 April 2020Johann Furmann 16 Kind of Sure
  • 23. Share Group (High Volume) Demo High Volume Community User AND Carla Sunflower 1. Create share set for Custom Demo Object and Community Profile 2. Share Group add Carla Sunflower 3. High Volume Community User creates Case Record -> Record is shared to Carla Sunflower too 20 April 2020Johann Furmann 17
  • 24. Implicit Sharing Johann Furmann SAIMA Group 17.04.2020 @fliack
  • 25. Sources Built-in Sharing Behavior https://help.salesforce.com/articleView?id=sharing_across_objects.htm&typ e=5 Implicit Sharing https://developer.salesforce.com/docs/atlas.en- us.draes.meta/draes/draes_object_relationships_implicit_sharing.htm 20 April 2020Johann Furmann 19
  • 27. © Nora Nicklis, 2020 Salesforce - Record Locks & Skews by Nora Nicklis
  • 28. © Nora Nicklis, 2020 Record Locks
  • 29. © Nora Nicklis, 2020 Types of Record Locks ● business-related → defined by business process and implemented intentionally (e.g. approval process, read-only record types) ● system-related → done by Salesforce, available and implemented out of the box (cannot be changed) Record Locks can happen
  • 30. © Nora Nicklis, 2020 UNABLE_TO_LOCK_ROW, unable to obtain exclusive access to this record Error
  • 31. © Nora Nicklis, 2020 System Related Record Locks Quality of a database is often measured by its data integrity: ● Data accuracy ● Data completeness ● Data consistency One measure by Salesforce (and many other databases) to maintain data integrity is to place record locks on records (and their parent records) while they are being edited.
  • 32. © Nora Nicklis, 2020 System Related Record Locks - Example (II) ABC LabsABC Labs Billing City Berlin 1. Billing City Sydney 2. Save3.Save4. 5.
  • 33. © Nora Nicklis, 2020 System Related Record Locks - Example (I) ID Account Rating 0013z00002Q4zFbAAJ ABC Labs A ID Account Rating 0013z00002Q4zFbAAJ ABC Labs B ID Account Rating 0013z00002Q4zFbAAJ ABC Labs C Data Load Integration Automation / Apex ❗ A given transaction can only wait a maximum of 10 seconds for a lock to be released, otherwise it will throw and UNABLE_TO_LOCK_ROW exception
  • 34. © Nora Nicklis, 2020 Skews
  • 35. © Nora Nicklis, 2020 skew ADJECTIVE Neither parallel nor at right angles to a specified or implied line; askew; crooked.
  • 36. © Nora Nicklis, 2020 Data Skews In a database, a skew refers to a situation in which there is an uneven distribution of data.
  • 37. © Nora Nicklis, 2020 Data Skews In a database, a skew refers to a situation in which there is an uneven distribution of data.
  • 38. © Nora Nicklis, 2020 Data Skews In a database, a skew refers to a situation in which there is an uneven distribution of data.
  • 39. © Nora Nicklis, 2020 Data Skews in Salesforce In Salesforce, data skews happen when records relate to one another and child records are unevenly distributed across the parent records. They will typically result in performance issues. There are three kinds of data skews that can occur: ● Account Skew ● Ownership Skew ● Lookup Skew
  • 40. © Nora Nicklis, 2020 Lookup Skew - Overview Lookup Skews happen in object relationships when a large number of child records are associated to one parent record. When a child record is inserted or updated, Salesforce locks the parent record the child will be associated to in order to maintain data integrity. When you work with large data, and there are processes (e.g. custom code, automated processes, integrations) you can easily run into lock contention. ❗ Lookup skews happen in lookup relationships AND master-detail relationships (Locks only occur on lookup relationship if it is not configured to clear the value of this field if the lookup record is deleted) ❗ Lookup skews can effect standard AND custom objects
  • 41. © Nora Nicklis, 2020 Lookup Skew - Example Rank__c Player__c - Scout - Explorer - Mountaineer 1.000.000 Players, each will be assigned a rank Result → Each rank will have approx. 333.333 child player records → Potential lock issues when loading/updating player information
  • 42. © Nora Nicklis, 2020 How to Identify a Lookup Skew There is no exact identifier by which you will be able to identify a lookup skew. Don’t wait until somebody complains, try to address to problem right away. Take a look at the following. ● Objects with a lot of records ● Objects where a lot of inserts and updates happening in parallel ● Objects where you get complaints about locks from users
  • 43. © Nora Nicklis, 2020 How to Handle Lookup Skews Whenever possible, try to avoid Lookup Skews! If it is not possible to avoid an Lookup Skew, look at the following strategies to soothe them: ● Reducing Record Save Time (Apex Best Practices, Asynchronous processing, Consolidate Automation) ● Picklist fields ● Distributing the skew (Add records on parent, Default = Blank, Review need,) ● Reducing the load (Serial loading, Order by parent ID and chunk the data carefully)
  • 44. © Nora Nicklis, 2020 Account Skew - Overview An Account Skew arises, when a large number of child records (>10.000) are related to a single account. There are two main problems that can be caused by an Account Skew: ● Record Locking ● Sharing Problems
  • 45. © Nora Nicklis, 2020 Account Skew - Sharing Problems Sharing problems arise because of Salesforce built in parent implicit sharing. (Users with access to to contacts, cases and opportunities get read access to the related account) If sharing of a child record of a certain object is updated, Salesforce will have to check all other children of that object to check, if the implicit share for the Account can be removed. ● Depending on the amount of children, the recalculation can take long and will cause performance issues ● During the whole operation, a lock is placed on the account preventing other from editing it
  • 46. © Nora Nicklis, 2020 Account Skew - Example Dummy Account Owner: Matt 1. Lara Smith Owner: Nora 2. Joey Young Owner: Sarah ... ... Owner: ... 23 456. Carlos Rodriguez Owner: Yin 23 457. Fumiko Suzuki Owner: Nora
  • 47. © Nora Nicklis, 2020 Account Skew - Example Dummy Account Owner: Matt 1. Lara Smith Owner: Camilla 2. Joey Young Owner: Sarah ... ... Owner: ... 23 456. Carlos Rodriguez Owner: Yin 23 457. Fumiko Suzuki Owner: Nora
  • 48. © Nora Nicklis, 2020 How to Handle Account Skews Whenever possible, try to avoid Account Skews! To do so, try to follow these suggestions: ● Limit the amount of Account children per object to 10.000. ● If you need generic Accounts, create a pool of accounts and use a round robin algorithm to distribute them ● Consider setting the Account OWD to “Public Read/Write” (the record locking will stay, but sharing calculations won’t happen) ● Redistribute existing child object records during off hours (Batch Apex, Bulk API)
  • 49. © Nora Nicklis, 2020 Ownership Skew - Overview An ownership skew happens, if a single user owns more than 10.000 records of one object. Performance issues caused by an ownership skew will most typically appear in large organisation where data changes that require sharing recalculation happen frequently. These changes could happen on: ● Ownership based sharing rules ● Record ownerships ● Group members / Role Hierarchy
  • 50. © Nora Nicklis, 2020 Ownership Skew - Example Joey Young Owner: Sam Sales Contact ID User/Group Row Cause 0033z00002fpwsYAAQ Sam Sales Owner Contact ID Owner Name 0033z00002fpwsYAAQ Sam Sales Joey Young User Groups Camilla Chief * CEO Sally Sales * VP Sales Sam Sales Sales Rep CEO VP Sales VP Finance Account ant Sales Rep Sally Sales Sam Sales Fred Finance Anna Accountant Camilla Chief * implicit sharing Contacts Table Contact Sharing Table Group Maintenance Table
  • 51. © Nora Nicklis, 2020 Ownership Skew - Example Joey Young Owner: Sam Sales Contact ID User/Group Row Cause 0033z00002fpwsYAAQ Sam Sales Owner Contact ID Owner Name 0033z00002fpwsYAAQ Sam Sales Joey Young User Groups Camilla Chief * CEO Sally Sales * VP Sales Sam Sales VP Finance CEO VP Sales VP Finance Account ant Sales Rep Sally Sales Sebastian Sales Sam Sales Anna Accountant Camilla Chief * implicit sharing Contacts Table Contact Sharing Table Group Maintenance Table
  • 52. © Nora Nicklis, 2020 Reasons for Ownership Skews Common reasons for ownership skews: ● The System Administrator is a fallback/default owner during automation processes/data migration ● Usage of a dummy user (for unassigned records, for records created through integrations)
  • 53. © Nora Nicklis, 2020 How to Handle Ownership Skews Whenever possible, try to avoid Ownership Skews! If it is not possible to avoid an Owernship Skew, try to follow these suggestions: ● Ensure that the “skewed” owner is not part of the role hierarchy or put them in a role at the top of the hierarchy/within its own branch ● Don’t move the user into another role / move the role within the role hierarchy ● Keep the user out of public groups used for sharing ● For organization wide sharing, review OWDs (is private necessary?) ● Consider granting access on profile level or using criteria based sharing rules for sharing with a group of users
  • 54. © Nora Nicklis, 2020 Summary Whenever possible, try to avoid Skews! If not, don’t worry! Identify them early and apply strategies learned to soothe/handle them.
  • 55. © Nora Nicklis, 2020 Sources ● https://developer.salesforce.com/blogs/engineering/2013/04/managing-lookup-skew-to-avoid-record-lock-exceptions.html ● https://developer.salesforce.com/blogs/engineering/2012/04/avoid-account-data-skew-for-peak-performance.html ● https://resources.docs.salesforce.com/sfdc/pdf/salesforce_record_access_under_the_hood.pdf ● https://developer.salesforce.com/blogs/engineering/2012/06/architect-salesforce-record-ownership-skew-for-peak-performance- in-large-data-volume-environments.html
  • 56. Summary ● Slides & Recording will be shared after the meeting (Slides → Linkedin, Recording → Youtube) ● Unanswered questions will be answered in the upcoming days in the comments of the video ● We will keep you posted on the topics and the date for the next session (if your are interested in being a presenter next time, please reach out)