Sub topic 7
Choosing a sandbox type for the job
This chapter assumes you know the four sandbox types and what each one copies from production. It also assumes you know the storage limits and refresh intervals. Here you use that knowledge to pick a type for a task. You will see the decision criteria, the mistakes teams make, and a way to map a release pipeline onto sandboxes.
Start from the task, not the type
Teams often pick the biggest sandbox they are licensed for. That is usually a mistake. A larger sandbox copies more data and refreshes less often, so it is slower to reset. It can also expose production data to more people than needed.
Ask four questions in order:
- Does the work need production data at all, or only production metadata?
- How much data does it need, and does it need specific records or a representative sample?
- How often will you need to reset the environment to a clean state?
- Does the test depend on realistic data volume, such as load, query selectivity, or batch duration?
The answers narrow the choice quickly.
Reference table
Check the current Salesforce documentation before you rely on these numbers. Allowances vary by edition and by what you have purchased.
| Type | Data copied | Data storage | File storage | Refresh interval |
|---|---|---|---|---|
| Developer | Metadata only | 200 MB | 200 MB | 1 day |
| Developer Pro | Metadata only | 1 GB | 1 GB | 1 day |
| Partial Copy | Metadata and a sample of data, defined by a template | 5 GB | Same as production | 5 days |
| Full | Metadata and all data | Same as production | Same as production | 29 days |
The refresh interval is the minimum wait before you can refresh the same sandbox again. It is not a schedule that runs automatically.
Matching common tasks to types
Feature development and unit testing
Use Developer sandboxes. Each developer, or each small team, gets one. Developers rarely need production records. They need metadata and test data created by Apex test classes or small loaded data sets. A one-day refresh interval lets a developer reset to match production after a release.
Choose Developer Pro when the work needs more room. Examples are loading a few hundred thousand test records, storing large files, or building a data set for a complex integration.
QA and user acceptance testing
Use Partial Copy when testers need realistic records, such as accounts with related contacts and opportunities. They do not need every record. A sandbox template picks the objects and the record count per object. The 5-day refresh interval suits a regular test cycle.
Because a sandbox template controls what Partial Copy copies, plan the template early. A bad template can leave testers with orphan records, such as contacts without their accounts. Include parent objects whenever you include their children.
Integration testing
Developer Pro or Partial Copy usually works. The deciding factor is whether the external system sends or expects data that must match records in Salesforce. If the other side holds copies of production keys, you may need Partial Copy or Full so those records exist.
After a refresh, integration endpoints and credentials may still point at production. Plan a post-refresh step to reset them, as covered in later chapters.
Performance, load, and staging tests
Use a Full sandbox. Only a Full sandbox has production's data volume. That matters for query selectivity, indexes, batch Apex duration, and report speed. A test that passes against 50,000 records can fail against 20 million.
A Full sandbox is also the usual staging environment, where you rehearse a release before production. Treat results as a strong signal, not a guarantee. Sandboxes share infrastructure, so absolute timings can differ from production.
A decision flow
Real choices have more constraints than this. Use the flow to find the smallest type that meets the need, then check licensing and refresh timing.
Constraints that override the ideal choice
- Licenses. Your edition limits how many sandboxes of each type you have. Many orgs have a handful of Full or Partial sandboxes and many Developer ones. Design around what you own.
- Refresh cadence. A Full sandbox refreshes at most once every 29 days. If your release cycle is two weeks, the Full sandbox cannot be reset between releases. Plan for it, for example by deploying releases forward onto it instead of refreshing it each time.
- Data sensitivity. Partial Copy and Full sandboxes copy production data, which may include personal or regulated information. Developers on a Developer sandbox do not see production records. Using a larger type exposes data to more people, so limit who gets access and consider data masking.
- Storage ceilings. A Developer sandbox that exceeds its storage limit blocks further data creation. Find this out before a load test, not during one.
Mapping a pipeline
A typical pipeline uses a different type at each stage:
| Stage | Sandbox type | Reason |
|---|---|---|
| Individual development | Developer | Cheap, quick to reset, no production data |
| Shared integration of changes | Developer Pro | More room for combined work and test data |
| QA and UAT | Partial Copy | Realistic sample, 5-day refresh |
| Staging and performance | Full | Production volume and full rehearsal |
Not every team needs all four stages. A small team may use Developer sandboxes plus one Partial Copy sandbox for QA.
Defining the type when you create a sandbox
The type is set by the license type when you create the sandbox. In the CLI, you set it in the definition file. Here is a Developer Pro example:
{
"sandboxName": "qa1",
"licenseType": "Developer_Pro"
}The other values are Developer, Partial, and Full. Create the sandbox from the production org, authorized with the alias prod:
sf org create sandbox --definition-file config/sandbox-def.json --alias qa1 --target-org prodLater chapters cover the CLI and Setup creation flows in detail.
Common mistakes
- Using Full for everyday development. The 29-day refresh interval makes resets slow, and copying production data to every developer widens exposure.
- Using Developer for QA. Testers cannot find realistic records, and they end up creating data by hand.
- Skipping a template for Partial Copy. A Partial Copy sandbox needs a template to define its sample. Without careful selection, related records may not line up.
- Testing performance on a small sandbox. Results from a small data set say little about production behavior.
- Forgetting the refresh clock. Refreshing a sandbox right before you need it reserves the interval. If the refresh fails or the data is wrong, you may have to wait to try again.
Exercise
Your team has a two-week release cycle. QA needs realistic accounts, contacts, and opportunities, and a final rehearsal must run against production-sized data. Which sandbox types would you assign to QA and to the rehearsal, and what problem will you hit with the rehearsal sandbox's refresh schedule?
Show answer
Use a Partial Copy sandbox with a template for QA, since it holds a realistic sample and refreshes every 5 days. Use a Full sandbox for the rehearsal because it has production volume. A Full sandbox can be refreshed only every 29 days, so it cannot be reset before every two-week release. Plan to deploy releases onto it incrementally and refresh it on a slower schedule.
Exercise
A developer needs to test a Visualforce page against 400 MB of generated test records. Developer sandbox storage is 200 MB. Which type should you pick, and why not a Full sandbox?
Show answer
Pick Developer Pro, which has 1 GB of data storage and a 1-day refresh interval. A Full sandbox would work for the storage but is excessive. It copies all production data, refreshes only every 29 days, and is a limited resource that other teams need.