Protecting the data contract: Bulk-safe code
Why this deserves attention
Salesforce transactions may process many records even when the original change appears singular. The important work is to turn the assumption into a visible decision.
SOQL or DML inside loops consumes limits quickly and turns normal data loads into outages. On 12 May 2026, this archive entry records the principle as a practical design concern rather than a product announcement.
Stabilise the contract
Look at bulk-safe code through how meaning, validation and change control keep producers and consumers aligned. The objective is not to introduce more process; it is to expose the few decisions that determine reliability, ownership and future change.
Collect identifiers, query once, transform in memory and perform set-based DML with deliberate partial-failure handling. Record the decision close to the solution so that delivery, support and future architecture reviews work from the same intent.
What good looks like
The same code supports interactive updates, imports and integrations without separate implementations. The team can describe the expected behaviour, the owner, the evidence of success and the response when reality differs from the design.
A useful next step is to review one live implementation against this principle, identify the largest unowned assumption and turn it into a bounded improvement with a measurable outcome.
Official reference
Salesforce Apex Developer Guide