Ga naar inhoud

Sharing Has a Number of Zeros

Deze inhoud is nog niet vertaald.

Module 1 of 6 in the chapter Sharing at Scale, chapter 22 of Securing Salesforce: Sharing and Visibility. Each module stands on its own.

The question this module answers: Before a sharing design meets real data, how do you tell whether it will hold up?

Every scale conversation I have starts with the same question. When someone can’t give me a number, I use what I call Steve’s number of zeros: are we talking about 10 of these? 100? A thousand? A million? You go from clearly too small to clearly too big, and they find the answer in between.

Chapter 7 module 4 asked it of sharing rules: how many buckets? This chapter asks it of the sharing itself. Because sharing isn’t free. Every grant is a row Salesforce stores and maintains, and those rows have their own number of zeros. The Data Architect course takes the share table apart: the share object behind each object, one row per grant, and how fast the rows add up (Volume Meets the Sharing Model).

So for sharing, count three things:

  • The records. How many of this object, now and in three years?
  • The grants per record. How many rules, teams, manual shares or code-written shares reach each one?
  • Who each grant goes to. A group, or person by person?

Multiply the first two, and you have the rows in the share table. The third decides whether that number is sensible or a monster.

Here’s the arithmetic I walk through in class. You’re doing a data load of a million accounts for go-live. Your sharing logic gives each account, on average, ten user shares. That’s ten million share rows, before anyone logs in.

How do you get ten million shares in? There are two ways. You can load the accounts and let a batch class work out the shares, and it can run for hours, a day or two. Or you can calculate the shares ahead of time and insert the share rows themselves with a bulk data load. For a day-zero go-live, the second is often the one that fits the weekend.

And I’ve had clients whose rules about who sees what live in another system entirely. They feed the share rows in through the REST API or the Bulk API. Share rows can be written from inside Salesforce or from outside it. Either way, they’re rows, and you count them. Chapter 11 module 5 covers day zero for code-written shares, including deferring sharing calculations while you load.

Look at that ten again. Ten user shares per account. Why users?

The cheapest lever at scale is the one the Data Architect course quotes from Salesforce: share with a group instead of with each person in it, because it means fewer sharing rows. Ten people who always see the same accounts are one group, and one row per account, not ten. When someone joins or leaves, you change the group once, not a million rows.

That’s the question behind every design choice in this chapter: is this grant going to a group, a role or a territory, or is it going person by person? Person by person is fine at ten. It isn’t at a million.

Here’s a story someone in my class told. They’d been asked to clean up an org where sharing had been done with Apex and manual shares, written person by person, record by record. Over 100 million of them. It took them about a week just to remove the shares, and then the org’s whole approach to who sees what had to be redesigned.

What’s the lesson? Their own summary was that code-written shares should be rare, kept for small things, and that at that many records and users you need a different design. Mine is shorter: watch your granularity. Nobody sets out to make 100 million shares. They make one share per person per record, and the zeros do the rest.

You can’t see any of this in a developer org with fifty records. Salesforce’s own advice for bulk loads and relationship changes is plain: “always test substantial data uploads and changes to object relationships in a full copy sandbox that’s been recently refreshed so you know what to expect” (Object Relationships, Bulk Loading, and Sharing Recalculation (opens in a new tab), Designing Record Access for Enterprise Scale, Salesforce Developers, checked 2026-11-26).

So the number of zeros gives you the size. The full copy sandbox gives you the time. Load the day-zero volume, run the sharing, and time it, before the go-live weekend does it for you.

Sharing has a number of zeros Sharing has a number of zeros. A million accounts, times ten shares each, makes ten million share rows on day zero. Two ways to load them: a batch class that works them out, running for hours or a day or two; or a bulk load of the share rows themselves, calculated ahead, which can also come from an outside system through the REST or Bulk API. Below, the lever that keeps the number sensible: share with a group, one row per account instead of ten, and change the group, not the rows. Footnote: count the share rows, not just the records. {"author": "Steve Simpson", "blueprint": "1.0.0", "builder": "standard 1.60.0", "built": "2026-11-23", "id": "DGM-SVA-SCL-01", "rights": "\u00a9 2026 Twinshark LLC. All rights reserved.", "template": "cells 0.5.0", "theme": "stevetecharc 1.5.0"} THE ARITHMETIC TWO WAYS TO LOAD THEM THE LEVER THE ARITHMETIC TWO WAYS TO LOAD THEM A million accounts the day-zero data load Ten shares each on average, person by person Ten million share rows before anyone logs in A batch class works them out: hours, a day or two A bulk load of share rows calculated ahead, or fed by another system through the API Share with a group one row per account, not ten; change the group, not the rows instead times makes loaded by or by Count the share rows, not just the records. HOW TO READ IT fewer rows © 2026 Twinshark LLC · stevetecharc.com
Click to enlarge

Test knowledge. Know that every explicit grant is a row in the object’s share table, so records times grants per record is share rows; that sharing with groups instead of individuals means fewer sharing rows and fewer changes when people move; that share rows can be loaded in bulk or written by code, inside or outside Salesforce; and that substantial loads are tested in a recently refreshed full copy sandbox. This supports IMP-1, the scalability implications of the sharing solution. A likely area, not a known question.

  • For each object with explicit sharing: the records, the grants per record, and who each grant goes to, now and in three years.
  • Whether each grant goes to a group, a role or a territory, or person by person, and why.
  • How day zero’s shares get in: a batch class, a bulk load of share rows, or an outside system, and how long it takes.
  • Where code-written shares are allowed, and the granularity at which they stop being allowed.
  • The full copy sandbox test: what volume, what timing, before go-live.

Beyond the exam: what AI changes. An AI assistant asked to “make sure the right people see these records” will often write one share per person per record. It works on the first day with fifty records. Ask it how many rows it would write at a million records, and whether a group would do.