Sub topic 6
Types of Orgs
This chapter assumes you know what a CRM does, how SaaS works, and what databases, tables, and records are. It also assumes you know that an org is one customer's isolated space on Salesforce, with its own data and configuration. Here you will learn the main org types and how to pick one for a task.
Why there are several org types
Teams should not build and test changes in the org where real customers' records live. Salesforce provides different org types so you can separate live work from experiments. Each type differs in purpose, lifespan, and what data it holds.
The main org types
| Org type | Purpose | Lifespan | Typical data |
|---|---|---|---|
| Production | Runs the live business | Long-lived | Real customer data |
| Sandbox | Develop, test, train | Refreshable copy | Copied from production, depending on sandbox type |
| Scratch org | Source-driven development and automated tests | Short, 1 to 30 days | None unless you load it |
| Developer Edition | Free learning and prototyping | Long-lived, but inactive orgs can be removed | Sample data only |
| Trial | Evaluate a product | Limited, often 30 days | Sample data |
Production
A production org is where users do real work. Changes here affect the business immediately, so teams usually make changes elsewhere first and then deploy them.
Sandbox
A sandbox is a copy of a production org. It gives you a safe place to build and test. A sandbox always belongs to a production org, and the production org's edition and licenses determine which sandbox types and how many you can have. Sandboxes come in several types, which a later chapter covers.
Scratch org
A scratch org is a disposable org created from a definition file. Because the file describes the org, you can recreate the same org whenever you need it. Scratch orgs fit teams that keep their configuration in version control. You create them with the Salesforce CLI and a Dev Hub org.
Developer Edition
A Developer Edition org is a free org for learning and experiments. It is not a copy of anything and holds only sample data. It is a separate, standalone org.
Trial
A trial org lets a prospect try a product for a limited time. Some trials can be converted into paid production orgs. Do not treat a trial as a place to keep work you need to keep.
How the types relate
Sandboxes derive from production. Scratch orgs derive from a definition file and are created through a Dev Hub. Developer Edition and trial orgs stand alone.
Choosing an org for a task
Match the task to the org type:
- Learning Salesforce or trying a feature: use a Developer Edition org.
- Testing a change against realistic data: use a sandbox.
- Building with version control and automated builds: use scratch orgs.
- Evaluating a product before buying: use a trial.
- Running the live business: use production.
Creating a scratch org
A scratch org needs a definition file. This one requests a Developer edition scratch org.
{
"orgName": "Tutorial Scratch Org",
"edition": "Developer"
}Save it as config/project-scratch-def.json. Then create a seven-day org with the CLI, using a Dev Hub you have already authorized.
sf org create scratch --definition-file config/project-scratch-def.json --alias tutorial-scratch --duration-days 7When the seven days pass, Salesforce deletes the org. That is intended, so keep your work in source control, not in the org.
Common errors
- Building in production. Changes there take effect for live users.
- Expecting a scratch org to hold your data. It starts empty and expires.
- Using a Developer Edition org as a sandbox. It is not a copy of production.
- Assuming every edition allows sandboxes. Availability depends on the edition and licenses.
Exercise
Your team keeps its configuration in version control and wants a clean, identical org for each automated test run. Which org type fits, and what creates it?
Show answer
A scratch org. You create it from a definition file with the Salesforce CLI, using a Dev Hub org. Each run can get a fresh, identical org that expires on its own.
Exercise
You want to test a change against a realistic copy of your company's configuration without risking live data. Which org type do you use, and what does it belong to?
Show answer
A sandbox, which belongs to your production org and is copied from it.