~learn.
0:00 / 1:06
W09 · Multi-tenancy and security

Salesforce fails your transaction at query 101. On purpose.

transcript

Run 101 queries in one Salesforce transaction. It fails. Immediately. That's not a bug. It's how 150,000 customers share one platform.

They're called governor limits. Every transaction gets 100 queries. 50,000 query rows. 10 seconds of CPU. And 150 statements that change data.

The gentler option is soft limits. Monitor, alert, and step in by hand. But by the time you react, the damage is done. Hard limits stop it on the spot. The transaction fails, with a governor limit exception.

The result: over 150,000 customers, on shared infrastructure. With predictable performance. One tenant's runaway code can't starve the rest.

And the limits pay off in other ways. They force efficient code. They're visible, with usage dashboards and clear error messages. And they're an upgrade path. Higher limits, higher tier.

Strict limits are what make massive multi-tenancy possible. Hard beats soft. Limits are a feature, not a bug.

Full breakdown in the lecture.