Salesforce DictionaryPersistent copy vs disposable development environment
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.
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.
| Dimension | Sandbox | Scratch Org |
|---|---|---|
| Data | Can include production data (Full/Partial) | Starts empty — no production data |
| Lifespan | Persistent — lasts until refreshed or deleted | Temporary — expires in 1 to 30 days |
| Configuration | Copy of production metadata and optional data | Defined via scratch org definition file (JSON) |
| Source Control | Manual deployment or change sets | Native Salesforce DX and source-driven development |
| Use Case | UAT, staging, training, integration testing | Feature development, CI/CD, automated testing |
UAT, staging, training, or integration testing with production-like data.
Feature development, CI/CD pipelines, and disposable dev environments.