Sharing at scale: skew, recalculation and group design
Why large orgs struggle with sharing: ownership and account data skew, deep role hierarchies, group membership calculations, sharing recalculation, and techniques such as deferral and parallel recalculation.
Simple explanation
Every grant of access is stored as share rows and group memberships. Changes to owners, roles, groups, rules or parent records cause recalculation, which in large orgs can be slow and cause lock contention.
Common causes
- Ownership skew: one user owns a very large number of records of one object (often an integration user or a "dummy" owner).
- Account data skew: one account with tens of thousands of child records (contacts, cases, opportunities).
- Deep or wide role hierarchies and many nested public groups.
- Frequent ownership changes (realignment, mass transfers) and many sharing rules.
Techniques
- Spread ownership across several users; if a "system" owner is needed, place that user outside the role hierarchy or at a leaf role with no subordinates β verify current guidance.
- Avoid catch-all accounts; split them (for example by region or year).
- Keep the role hierarchy flat and meaningful; prefer territories or teams for coverage.
- Defer sharing calculations during big changes, then recalculate; schedule realignments out of hours.
- Use parallel sharing rule recalculation (where available) and plan for group membership locks during user and role changes.
Real-world analogy
Sharing at scale is like updating every keycard in a skyscraper when someone changes department. With a few people, it's instant. If one person (skewed owner) holds the keys to 2 million rooms, or the building has 15 levels of managers each inheriting keys, every change means re-cutting thousands of cards.
Worked example
A distributor's integration user owned 6 million orders; each owner change triggered long recalculations and lock errors. Fix:
- Orders owned by a small pool of regional integration users placed outside the role hierarchy; visibility through criteria-based sharing to regional groups.
- A "Walk-in Customers" account with 400,000 contacts split into one account per region and year.
- Annual territory realignment run with sharing deferral in a weekend window; recalculation monitored to completion.
Diagram
Key points
- Access is stored as share rows and group memberships; changes trigger recalculation.
- Ownership skew and account data skew are the classic culprits.
- Keep role hierarchies flat; use teams or territories for coverage.
- Defer sharing calculations and schedule big changes.
- Place system owners outside the hierarchy; split catch-all accounts.
- Test large changes in a full sandbox with timings.
Limits and gotchas
- Deferral is enabled through Support for some orgs and needs a recalculation step afterwards β verify.
- Group membership changes (users changing roles) lock group tables; mass user updates are best done off-hours.
- Implicit sharing means child skew also affects the parent account's sharing.
- Too many sharing rules per object slow recalculation; consolidate with criteria and groups.
π€ How to say this in an interview
LDV and security meet here. If an interviewer mentions millions of records, many owners or realignments, bring up skew, recalculation, deferral and hierarchy design before they ask.
Common follow-ups
Why does placing the integration user outside the role hierarchy help?
Records owned by a user in the hierarchy must be shared upward to every manager role above them. A user with no role (or a leaf role) avoids those calculations; access is then granted deliberately through sharing rules.
How do you plan a mass ownership transfer of 2 million records?
Run it in batches out of hours, consider sharing deferral, sort by parent to reduce locks, pause non-essential automation, monitor recalculation, and rehearse in a full sandbox first.