Salesforce Dictionary — Free Salesforce GlossarySalesforce Dictionary

Sandbox vs Scratch Org

Persistent copy vs disposable development environment

All comparisons

Sandbox

VS

Scratch Org

Sandbox

A Sandbox is a copy of your Salesforce production environment used for development, testing, and training. Sandboxes come in four types: Developer, Developer Pro, Partial Copy, and Full. They allow teams to build and test changes in isolation before deploying to production, protecting live data and users from unfinished or buggy configurations.

Scratch Org

A Scratch Org is a temporary, fully configurable Salesforce environment that developers create from a Dev Hub using Salesforce DX. Scratch Orgs are designed for development and testing, can be spun up in seconds with a specific configuration defined in a JSON file, and are automatically deleted after a maximum of 30 days.

Key Differences

DimensionSandboxScratch Org
DataCan include production data (Full/Partial)Starts empty — no production data
LifespanPersistent — lasts until refreshed or deletedTemporary — expires in 1 to 30 days
ConfigurationCopy of production metadata and optional dataDefined via scratch org definition file (JSON)
Source ControlManual deployment or change setsNative Salesforce DX and source-driven development
Use CaseUAT, staging, training, integration testingFeature development, CI/CD, automated testing

When to use Sandbox

UAT, staging, training, or integration testing with production-like data.

When to use Scratch Org

Feature development, CI/CD pipelines, and disposable dev environments.