All Products
Search
Document Center

Serverless App Engine:Isolate environments with namespaces

Last Updated:May 15, 2026

To distinguish between development, testing, and production environments for your applications, create a separate namespace for each environment. Applications within the same namespace can communicate with each other over the internal network, while applications in different namespaces are isolated from one another.

Solution overview

This topic shows you how to create three namespaces: dev, test, and prod for your development, testing, and production environments, respectively. After you deploy an application to one namespace, you can copy it to other namespaces and modify its configuration as needed. You can also perform batch operations on applications in any environment to improve operational efficiency.

Procedure

1. Create namespaces

  1. Log on to the SAE console. In the top navigation bar, select the region for your application. This topic uses China (Hangzhou) as an example.

  2. You can create multiple namespaces in the same region. First, create the dev namespace. In the left-side navigation pane, choose Namespace and click Create Namespace. Set Namespace Name and Namespace ID to dev.

  3. Create and associate a VPC with the dev namespace. Click Create VPC to go to the VPC Management Console. Ensure the Region for the VPC matches your application's region and set the Name to dev-vpc. Configure the VPC's CIDR block as needed. For more information, see Create and manage a VPC.

    A VPC is the private network where your applications run. A namespace can be associated with only one VPC, placing all applications from that namespace into the same network.
  4. Applications must be deployed in a vSwitch. Create two vSwitches in different zones within dev-vpc to improve application availability. Customize the vSwitch's Name, Zone, and IPv4 CIDR Block. For more information, see Create and manage a vSwitch. Then, click + Add to configure the second vSwitch. Click OK.

    vSwitches within the same VPC can communicate with each other over the internal network.
  5. Return to the SAE console. In the Create Namespace panel, select the VPC that you created for the Virtual Private Cloud field. Click OK.

You have now created the dev namespace. You can repeat these steps to create the test and prod namespaces.

To ensure that applications in different namespaces are isolated, you must create and associate a different VPC for each namespace. Otherwise, applications in different namespaces can communicate over the internal network, which prevents proper environment isolation.

2. Deploy applications

You can first deploy an application to the dev namespace, and then copy it to the test and prod namespaces.

  1. In the left-side navigation pane, choose Application Management > Applications. Select dev for the Namespace and click Create Application. Deploy your applications to the dev namespace, specifying the VPC and vSwitches you created in the previous step. For detailed instructions, see Deploy an application.

  2. In the Application List list, select an application and click Copy in the Actions column. Select test or prod for the Namespace to copy the application to the corresponding namespace. You can also change the application's configuration to meet the requirements of different environments.

3. Perform batch operations

You can batch start or stop applications in the development, testing, or production environments. You can perform batch operations on applications manually or create scheduled start/stop rules.