Introduction to Salesforce Environments

ליאור נכתב על ידי ליאור לביא, עודכן בתאריך 30/10/2023

In this post, we will learn about Salesforce environments, how they are defined, and their common uses.

After reading this post, you will know:

  • What instances, organizations, and environments are in Salesforce.
  • The different types of development environments in Salesforce and their roles in our pipeline, from initial development to deployment.
  • How to set up new environments.

What Are Instances, Organizations, and Environments in Salesforce

To understand environments, we first need to understand how Salesforce works, both physically and logically.

Salesforce owns several data centers worldwide. Each data center consists of a multitude of IT resources, such as application servers, databases, search and indexing services, file storage, and more.

Under each data center, there are defined instances. Each instance is a collection of all the IT resources required to provide Salesforce's services to its customers, and each instance serves around 10,000 customers. This architecture, where a large number of customers receive service from the same instance, is known as multitenancy. Instances themselves are divided into two types: Production and Sandboxes. The names of production instances consist of two letters representing their geographic location (e.g., EU for Europe and NA for North America) and a number, like EU32 or NA1. Development environments, also known as sandboxes, are called CS (Client Sandbox) and a number, for example, CS192.

Hierarchical Components of IT in Salesforce for Visualization

Data Centers and Instances

To identify each customer and provide them access only to their data and settings within the shared instance, Salesforce creates a unique key for each customer called an Organization ID. When a user accesses the https://login.salesforce.com page and enters their username and password, Salesforce identifies which organization ID the user is associated with and allows them access to its interface in the browser, exposing only the data associated with their organization ID. An organization, therefore, is a collection of settings and data that a customer has access to through their specific organization ID.

An Environment is an organization with a defined purpose. For example, our production environment is a collection of settings and data to which we and our users have access, where we work with real data. Our production environment is a part of a production instance, such as EU36 or NA3. From our production environment, we can create new environments of the Sandbox type. These environments are automatically set up by Salesforce on instances like CS192 or CS104 and allow us to perform testing, write developments, and conduct training without jeopardizing our production environment.

Summary

Data Center
A server farm containing numerous IT components, such as application servers, database servers, search and indexing services, and file systems.
Instance
A collection of IT components within a Data Center, through which Salesforce can provide all its services to customers. Each Instance serves around 10,000 customers. Instances are divided into two types: Production and Sandbox.
Organization
A collection of settings and data identified by an Organization ID and exposed only to users associated with the specific Organization ID.
Environment
An organization with a defined purpose, such as production, development, testing, and so on.

What Are the Different Types of Environments in Salesforce and Their Roles in Our Pipeline, from Initial Development to Deployment

One of the fundamental principles in software development is not to make changes directly in the production environment. Before introducing changes into the production environment, we want to develop and test them in a separate environment, where we can perform tests and examine our code without disrupting our users' work. For this purpose, Salesforce supports various development configurations, with one of them based on using specific environments known as Sandboxes.

Salesforce sandboxes are divided into four types:

  1. Full Copy
  2. Partial Copy
  3. Developer Pro
  4. Developer

In the following table, you can see the differences between the different types of Sandboxes:

  Full Copy Partial Copy Developer Pro Developer
Refresh Frequency 29 days 5 days 1 Day 1 Day
Storage Space Same as the source environment from which it was copied. Usually, the source environment is the production environment. 5 GB 1 GB 200 MB
Includes
  • Configurations - Validation rules, Process Builder, Workflows, and more.
  • Apex & Metadata
  • All users
  • Records (all or selected objects)
  • Support for Sandbox templates 🛈
  • (Optional) Chatter data and history
  • Configurations - Validation rules, Process Builder, Workflows, and more.
  • Apex & Metadata
  • All users
  • Records (sampled from selected objects)
  • Support for Sandbox templates 🛈
  • Configurations - Validation rules, Process Builder, Workflows, and more.
  • Apex & Metadata
  • All users
  • Configurations - Validation rules, Process Builder, Workflows, and more.
  • Apex & Metadata
  • All users
  • Refresh Frequency - Indicates how often we can completely delete our development environment and create a new, clean one. This action allows us to perform a "lineup" and ensure that the environment in which we develop is identical to the next environment to which we will transfer our development.
  • Storage Space - Indicates how much storage is allocated to our environment for storing records and data.

Using Different Types of Development Environments in Salesforce for Different Development Stages

  Full Copy Partial Copy Developer Pro Developer
Development    
Quality Assurance (QA)  
Integration Testing    
Data Processing in Batch    
Training    
User Acceptance Testing    
Performance and Load Testing      
Preparation for Deployment to Production      

Recommended Development Lifecycle in Salesforce Sandbox Configurations

Salesforce Recommended Development Life Cycle

How to Create New Environments

To create new environments in Salesforce, follow these steps:

  1. Go to the Setup screen. In the Setup menu on the sidebar, select Home > Platform Tools > Environments > Sandboxes. Sandboxes Menu Item
  2. Under the Sandboxes tab, you'll see two things: a summary of available sandbox licenses and a table displaying your existing sandbox environments with a button to create a new environment. Available Sandbox Licenses.png Sandboxes Tab

    The table itself displays the following columns:

    1. Action

      This column contains the actions you can perform on your sandbox environment:

      • Clone - Copy the environment.
      • Delete - Delete the environment.
      • Refresh - Refresh the environment, creating a new one.
      • Log In - Log in to the environment. Clicking this link will open a new browser tab for logging into the sandbox environment with the user who clicked the link in the production environment.
    2. Name

      The name of the environment. Clicking the link will open a screen with more information about the environment.

    3. Type

      The type of environment: Full, Partial Copy, Developer Pro or Developer.

    4. Status

      The status of the environment. After creating a new environment or refreshing an existing one, this field will provide information about the progress of creating or refreshing the environment.

    5. Location

      The name of the instance where your environment resides.

    6. Current Org Id

      The unique identifier for your sandbox environment.

    7. Completed On

      The date and time when the environment creation process was completed.

    8. Description

      The description of the environment, as defined when creating the environment.

    9. Copied From

      When creating a sandbox environment from another sandbox, this field will contain the name of the source environment from which the new environment was copied.

  3. Click the New Sandbox button.
  4. In the Create Sandbox screen, enter three values:
    1. Name - The name of your new environment without spaces.
    2. Description - A description for your environment.
    3. Created From - Select the environment from which you want to create the new environment as a copy.
  5. Under Sandbox License, click the Next button under the license you want to use, based on the type of Sandbox environment you want to create. Create Sandbox
  6. In the next screen, under Sandbox Options, you can choose a class that will run automatically after the environment is created. This class can create records and change settings in the environment to initialize it according to your needs. Create Sandbox - Apex Class

Another option available on the Sandboxes page is to use a sandbox template to choose objects from which you want to copy records to the new environment. This option is available for Full and Partial Copy sandbox environments. To use this option, click on the Sandbox Template tab, and then click the "New Sandbox Template" button.

Sandbox Templates

In the New Sandbox Template screen, you can define a name for your template, add a short description, and select the objects from which you want to import records into your new environment.

New Sandbox Template

Now, when you refresh your Partial Copy environment, you'll see the option to choose one of the templates you created and the objects from which your data will be sampled, along with the option to automatically activate the environment when it's ready and choose a class to run immediately after activation.

Create Sandbox Using Template

For Further Reading