While there are many ways to implement multi-tenancy depending on your production configuration, the high level steps involve choosing a space allocation strategy, creating super and regular tenants, defining their credentials, and enabling tables for multi-tenancy.

  1. Choose a space allocation strategy
  2. Enable the database for multi-tenancy with the Admin Console or the command line
  3. Create a super-tenant
  4. Create a domain for the super-tenant
  5. Add a user for the super-tenant
  6. Set up the super-tenant's database login user credentials
  7. Create a regular tenant, its domain, and its users
  8. Enable tables for multi-tenancy

Choose a space allocation strategy

Allocating space properly for a database is very important. It ensures that your database has sufficient space for current usage and can accommodate growth in the future. It also ensures that the database will perform well, is highly scalable, and can be reasonably administered and managed. OpenEdge RDBMS makes it easy for you to allocate space by providing physical database components such as Type II storage areas, extents, clusters, and database blocks.

Allocating space properly for a multi-tenant database is a bit more complex. Not only do you have to consider factors such as adequate space, capacity for growth, performance, scalability, and ease of administration, you also have to take into account tenant data storage and tenant data usage.

There are a variety of space allocation strategies you can use to design the physical layout of a multi-tenant database. All strategies have the following in common:

  • They require the use of Type II storage areas.
  • They have separate areas dedicated to shared tables, shared indexes, and shared LOBs.

Here are two commonly used strategies:

  • By tenant and object type
    Guidelines:
    • Tenants’ service level agreements require that tenant data be stored in separate areas.
    • Data storage requirements and data usage patterns are relatively homogeneous across tenants.
  • By tenant, object type, and data
    Guidelines:
    • Tenants’ service level agreements require that tenant data be stored in separate areas.
    • Data storage requirements and data usage patterns are different for different tenants; they require fine-tuning in the way data is stored.

Here is an example .st file for allocation by tenant and object type:

# Multi-tenant space allocation by tenant and object type 
#
b .
#
d "Schema Area":6,32;1 .
#
# Area for shared tables
#
d "Data":7,64;8 .
#
# Area for shared indexes
#
d "Indexes":8,64;8 .
#
# Areas for tenant data and indexes
# Each tenant has its own data and index areas.
#
# ---------- Tenant 1 ----------
d "T001_data":9,64;8 ./tenant1 f 1280
d "T001_data":9,64;8 ./tenant1
d "T001__idx":10,64;8 ./tenant1 f 320
d "T001__idx":10,64;8 ./tenant1 
# ---------- Tenant 2 ----------
d "T002_data":11,64;8 ./tenant2 f 1280
d "T002_data":11,64;8 ./tenant2
d "T002__idx":12,64;8 ./tenant2 f 320
d "T002__idx":12,64;8 ./tenant2
#
# After-image area
#
a . f 4096
a . f 4096
a . f 4096
a . f 4096
The example shows an a .st file that implements allocation by tenant and object type. The .st file contains the following areas:
  • Tenant1 has areas 9 and 10, and Tenant2 has areas 11 and 12.
  • Areas 9 (T1_Data) and 11 (T2_Data) are for storing tables for Tenant1 and Tenant2, respectively. Each has two extents, one fixed and one variable.
  • Areas 10 (T1_Index) and 12 (T2_Index) are for storing indexes for Tenant1 and Tenant2, respectively. Each has two extents, one fixed and one variable.

Enable multi-tenancy from the Database Administration Console

You can enable a database for multi-tenancy from the Database Administration Console.

To enable a database for multi-tenancy:
  1. On the management console menu, select Database Administration > Go to Database Administration.
  2. Filter or search for and select the database connection.
  3. In the Database Features section, verify the Multi-tenancy status.
    Note: You can click the Sort arrow to display the features in ascending or descending order.

    If the status is a check mark in a green circle and the word Enable does not appear in the Action column, the database is already enabled for multi-tenancy.

  4. Click Enable.
  5. Click Enable Multi-tenancy. A message appears confirming that the database is now multi-tenant.
  6. Click OK. The database home page appears, and the multi-tenancy status for the database reflects that the database is now enabled.

Enable multi-tenancy from the command line

To enable an OpenEdge database for multi-tenancy from the command line:
  1. Use the proutil command with the ENABLEMULTITENANCY qualifier. For example:

    proutil db-name -C enablemultitenancy

  2. To programmatically enable an OpenEdge database for multi-tenancy, use an OS-COMMAND statement. For example:
    DEFINE VARIABLE cCommandLine AS CHARACTER NO-UNDO. 
    ASSIGN 
    	cCommandLine = "proutil db-name -C enablemultitenancy". 
    OS-COMMAND SILENT VALUE(cCommandLine).
  3. To check whether an OpenEdge database is enabled for multi-tenancy or not, use the IS-DB-MULTI-TENANT function. For example:
    MESSAGE IS-DB-MULTI-TENANT("db-name") 
    	VIEW-AS ALERT-BOX INFO BUTTONS OK.
  4. To check whether an OpenEdge database table is multi-tenant table, use the IS-MULTI-TENANT attribute of its buffer object handle. For example:
    MESSAGE BUFFER Customer:HANDLE:IS-MULTI-TENANT 
    	VIEW-AS ALERT-BOX INFO BUTTONS OK.

Create a super-tenant

There are three varieties of tenants:

  • Super-tenant—A tenant that does not have its own data but can access all shared tables and all multi-tenant data in the database.
  • Regular tenant—A tenant that can access its own data, data for any other tenants in the same tenant group, or data in shared tables. (A shared table is one whose data is available to all tenants in the database.)
  • Default tenant—A tenant that does not establish tenancy as part of authentication to the database. Because the user has not established tenancy, the default tenant can access only shared table data within the database or the default partition of a multi-tenant table. There is only one default tenant per multi-tenant database.

Progress recommends that you set up at least one super-tenant to manage the database, and it is likely that you will want to set up at least one regular tenant as well.

To create a super-tenant:
  1. From the Database Administration Console, click Database Administration > Tenant.
  2. Enter a name in the Tenant name field.
  3. Optionally, enter a description for the tenant.
  4. Select Regular or Super as the tenant type.

    If you select Super, then you have to perform only steps 6 and 10.

  5. Optionally, clear the Enable data access option if you want to prevent a tenant from accessing its data.
  6. In the Database connection field, type a database connection name or click the search icon to select a database connection from the Connection Selection dialog box.
  7. For the Default data, index, and LOB area fields, type a storage area name or click the Search icon to select the storage area name from the Area Selection dialog box.
  8. Select an object allocation rule.
  9. Optionally, select the Copy default from option.
  10. Click Create tenant.

    The tenant is created.

  11. Repeat Steps 1 through 10 for each new tenant that you want to create.

For more information about creating super-tenants, see Create a new tenant for a multi-tenant database.

Create a domain for the super-tenant

For each tenant, you must create a domain. There are several predefined domains available for the database, or you can create your own. You can have multiple domains per tenant.

You can add one or more domains for a tenant by selecting from a list of predefined authentication systems that are configured for the database.

You can also add a domain to the database. For more information, see Manage domains in a multi-tenant database.

To add a domain:

  1. On the management console menu, select Database Administration > Go to Database Administration.
  2. Filter or search for and select the required database connection.
  3. Under Storage Management, click View tenants.
  4. Select the tenant for which you want to add a domain. The tenant details page appears.
  5. Under Manage Tenant, click Edit tenant.
  6. Click Domains.
  7. Click New in the tenant menu bar.
  8. Provide the following information:
    • Domain name—Type the domain name (required). Do not use spaces or special characters such as an asterisk (*), ampersand (&), or period ( . ) in this field. You can include the underscore (_).
    • The domain name represents the logical name of a single authentication system (domain) that can be used to validate the authentication of a user account.
    • Authentication system—From the drop-down list, specify the type of authentication system. (The available types exist in the database in the _sec-authentication-system table.)
    • Access code—Type an access code for the domain.
    • The access code you type is then encrypted and used to validate the identity and integrity of any CLIENT-PRINCIPAL issued by the authentication system represented by this domain.
    • Confirm access code—Retype the access code.
    • Description—Provide a description (optional).
    • Comments—Provide comments (optional).
    • Enabled—Select the check box to indicate that the domain is enabled (meaning that a user can log in).
    • Auditing context—Provide the audit record context value.
    • Runtime options—Provide a comma-delimited list of runtime options for this domain.
    • System options—Provide the system option value.
  9. Click Commit.

For more information about auditing and OpenEdge, see Learn about Security and Auditing.

Add a user for the super-tenant

After you have added a domain, you must create a user who can log in to the super-tenant in the database. You can have multiple users per domain.

To add a user:

  1. Click Database Administration > Go to Database Administration
  2. Filter or search for, and select the required database connection.
  3. Click View tenants in the Storage Management section.
  4. Select the tenant for which you want to add a user.
  5. Click Edit tenant in the Manage Tenant section.
  6. Click Users.
  7. Click New in the tenant menu.
  8. Provide the following information for the new user:
    • User name—Type the user's name (required). Do not use spaces or special characters such as an asterisk (*), ampersand (&), or a period ( . ) in this field. You can include the underscore (_).
    • Domain name—Enter a domain name or click the Search icon to open the Domain Selection dialog to select a domain name (required).

      The Domain Selection dialog displays the details of the domains in a grid. You can search or filter the domains in the grid by Domain name or Tenant name.

      You can also move forward or backward the page, or specify a particular page, in the list of domains by using the Page feature at the bottom of the grid.
      Note: You can select the column heading and click the drop-down to choose the order (ascending or descending alphabetically) for the domains to appear in the grid.
    • Password—Type the user's password.
    • Confirm password —Retype the user's password.
    • SQL Only—Select the check box to indicate that the _user table record can be used only by a SQL connection to authenticate to the database.

      If the check box is enabled, ABL clients cannot authenticate to the database by using user ID and user name.

      If the check box is disabled, both SQL and ABL users can use the record.

    • User number—Provide a number to identify the user (optional). The number must be a positive integer.
    • Description—Provide a description (optional).
    • Given name/Middle initial/Surname—Provide the user's given name, middle initial, and surname (optional).
    • Telephone—Type the user's telephone number (optional).
    • E-mail—Type the user's email address (optional).
  9. Click Commit in the tenant menu.

Set up the super-tenant's database login user credentials

By default, connections for databases defined in OpenEdge Management use the blank user ID. In order to access tenant data, you must set up the database connection to use the credentials for either a user for a regular tenant or for a super-tenant. Because super-tenants can access all users' data, establishing a database connection as a super-tenant will allow you to perform operations such as dumping and loading of data and editing sequences for any tenant. If you establish a connection with the credentials of a user for a regular tenant, you can perform operations for only that tenant.

To set up a login to a database connection:

  1. From the list of connections, select the connection for which you want to establish a login.
  2. Under Manage Database Connection, click Edit database connection.
  3. Select the Log in with these credentials option, and provide the user ID and password. Type the same password in the Confirm password field.
  4. Click Save.

Create a regular tenant, its domain, and its users

The procedures for creating a regular tenant, domain, and user are similar to the ones used for creating a super-tenant. Return to the previous sections for creating a super-tenant, domain, and user and use the procedures described there to create a regular tenant, its domain, and its users as needed.

Enable tables for multi-tenancy

From the management console, you can choose one or more tables not enabled for multi-tenancy, and enable them. You can then make decisions about partition allocation for the table or tables that have not yet been allocated. The allocation state you choose for a table applies also to the table's indexes and LOB fields. When you enable a table for multi-tenancy, you are affecting all tenants for a selected database.
Note: Note: A table must be in a Type II area in the database to be enabled for multi-tenancy. If a table, or any of its indexes or LOB fields, is not in a Type II area, you cannot enable the table for multi-tenancy.

In such a situation, the Notes column will identify which table, index, or LOB field is not in a Type II area, so you can correct the issue and then enable the table as multi-tenant.