Sub topic 2
Sandbox types: Developer, Developer Pro, Partial Copy, and Full
This chapter assumes you know the difference between production and non-production orgs, you have deployed metadata between orgs, and you have used a command line. It covers what each sandbox type copies from production and what limits it has. The next chapter covers how to create and refresh them.
What a sandbox is
A sandbox is a copy of a production org. It is a separate org, so changes made there do not affect production users. All four types copy your metadata: custom objects, fields, Apex, flows, page layouts, and settings. They differ in how much data they copy, how much storage they have, and how often you can refresh them.
The four types
| Type | Metadata | Data copied | Data storage | File storage | Refresh interval |
|---|---|---|---|---|---|
| Developer | Full copy | None | 200 MB | 200 MB | 1 day |
| Developer Pro | Full copy | None | 1 GB | 1 GB | 1 day |
| Partial Copy | Full copy | A sample, chosen by a sandbox template | 5 GB | 5 GB | 5 days |
| Full | Full copy | All data, with optional field history | Same as production | Same as production | 29 days |
Check current numbers in the Salesforce documentation before you plan around them. Limits can change between releases.
Developer
A Developer sandbox has your configuration and no records. It suits one developer's coding and unit testing. You create your own test data, so the small 200 MB limit rarely matters for this work.
Developer Pro
A Developer Pro sandbox is the same as a Developer sandbox with more storage. Use it when a developer or a small team needs more test data, for example for bulk Apex tests or for loading a larger data set by hand. It also suits integration work that must hold more records.
Partial Copy
A Partial Copy sandbox adds a sample of production data. You choose that sample with a sandbox template, which lists the objects to include. The copy is limited to 10,000 records per selected object. This type suits quality assurance and user acceptance testing when you need realistic relationships between records but not the full volume.
Full
A Full sandbox copies all metadata and all data. It has the same storage as production and the longest refresh interval. Use it for performance testing, load testing, and staging, where realistic data volume changes the result. Because it copies production data, it also carries the most data-protection risk. The data security chapter covers that.
Choosing by the question you need answered
Ask what the test depends on. Data volume decides between Partial Copy and Full. Realistic records decide between a metadata-only sandbox and Partial Copy.
Common errors
- Testing performance in a small sandbox. Query times and governor-limit behavior depend on data volume. A Developer sandbox with 50 records says little about production.
- Treating a Full sandbox as a personal workspace. Each developer refreshing a Full sandbox every 29 days is rarely possible, because the number of Full sandboxes is limited by your licenses. Give individuals Developer sandboxes and keep Full sandboxes for shared testing.
- Assuming sandbox data is safe. Partial Copy and Full sandboxes hold real customer records unless you mask them. They are non-production, but they are not anonymous.
- Running out of storage. A Developer sandbox that fills up blocks inserts and tests. Delete test data or move to Developer Pro.
- Forgetting the interval. After you refresh a Full sandbox, you must wait 29 days to refresh it again. Plan refreshes around release dates.
Naming the type in a definition file
When you create a sandbox with the CLI, the definition file names the type in the licenseType field. This example requests a Developer sandbox:
{
"sandboxName": "dev1",
"licenseType": "Developer"
}Changing licenseType changes the type. The next chapter shows how to run the command that uses this file.
Exercise
Your team must test a batch job that processes about two million Account records, and they want to measure how long it takes. Which sandbox type fits, and why do the other three not fit?
Show answer
A Full sandbox. Only a Full sandbox copies all production data at production storage size, so timing results are realistic. Developer and Developer Pro copy no data and have 200 MB and 1 GB of storage, which cannot hold two million records. Partial Copy holds a sample capped at 5 GB, so it cannot reproduce the real volume.
Exercise
A developer needs a clean workspace to write Apex and run unit tests that create their own records. Which type is the cheapest fit, and when would you move up to the next type?
Show answer
A Developer sandbox, because it copies metadata only and the tests create their own data. Move up to Developer Pro when the work needs more than 200 MB of data or file storage.