Working with Compartments in Oracle Cloud Infrastructure

Before I proceed further, I will assume that you have an understanding of what is a compartment in Oracle Cloud Infrastructure (OCI), if not do check my blog: The Compartments of Oracle Cloud Infrastructure.

In this blog, I have discussed various patterns for Compartment deployment. We know that we can have compartments nesting up to six levels. I would recommend not using all six levels of nesting, and restricting up to four.

The below table lists various Compartment nesting patterns

Level 1Level 2Level 3Level 4Level 5Level 6
Pattern#1Business UnitApplication NameEnvironmentService
Pattern#2ServiceApplication NameEnvironment
Pattern#3Application NameEnvironmentService

The combination of Business Unit, Application, Environment, and Service defines the way you want to define the structure of Compartments.

The Root compartment is treated as the base compartment for the Organization if the OCI Tenancy is intended to be used for multiple Business Units. In case, the OCI Tenancy is intended to be used only by a specific Business Unit, can ignore creating a compartment for the Business Unit.

The OCI CIS V2 Secure Landing Zone guidance mentions to use of separate compartments for network, security, application, and database.

Below are examples of Compartment structure patterns, I have mentioned above.


I have kept the Shared Compartment common for all Business Units. Based on your requirement you can create a shared compartment under the Business Unit compartment.



I hope the blog will help you to design the right compartment structure for your tenancy. Do not limit yourself to these patterns, and design what your organization needs. Provide your comments and suggestions if you have any questions.