This topic describes how to create and manage tenants in the OceanBase Cloud console.
Concepts
- Tenant: A tenant is a subset of instance resources and is a logical concept equivalent to a MySQL or Oracle instance. Tenants are the basis for managing database objects and resources. They are containers for various database objects and resources, such as CPU, memory, and I/O. OceanBase Cloud implements resource isolation by using tenants. The platform adopts a multi-tenant management model in a single instance. Resources and data are isolated between tenants. Each tenant owns a group of computing and storage resources and independently provides a complete set of database services. For more information, see Multi-tenant architecture.
- Resource unit (unit): A unit indicates the resources available to a tenant on a node, including memory, CPU, and I/O resources. It is also the basic unit for load balancing in the instance. When a node goes online or offline or the instance undergoes scaling in or scaling out, the distribution of units on the nodes is dynamically adjusted to achieve balanced resource usage. For more information, see Tenant resource management.
Prerequisites
The instance has been created. For more information, see Create an instance.
Limitations
You can calculate the maximum number of tenants that can be created in a single instance based on the following rules:
The maximum number of tenants = min( number of CPU cores per node in the instance × number of nodes in the instance, maximum number of tenants allowed for the instance), where:
For an instance deployed in the 3F mode (3 full-featured nodes), the default maximum number of tenants allowed is 50.
For an instance that adopts the 2F1A deployment mode (2 full-featured nodes and 1 arbitration node), the default maximum number of tenants allowed is 32.
Note
- For more information about instance deployment, see Product series.
- If you want to create more tenants, contact OceanBase Technical Support.
Procedure
Log in to the OceanBase Cloud console.
In the left-side navigation pane, click Instances.
In the instance list, find the target instance, click the instance name to go to the Overview page of the instance.
In the upper-right corner of the page, click Create.
Specify the following parameters of the tenant.
Parameter Description Tenant Name The name of the tenant. It must be 2 to 64 characters in length and can contain Chinese characters, digits, English letters, underscores, and hyphens. It cannot be sys. Compatibility Mode You can set the mode to MySQL Compatible or Oracle Compatible. Parameter Template Select a parameter template from 4 parameter templates. For more information, see Parameter template description. Note
Parameter templates are supported only for OceanBase Database V4.3.3 and later versions.
- OLTP Simple Transactions: This template is suitable for core systems such as online order transactions and payments, as well as internet businesses with high-concurrency point queries. Each executed SQL statement is simple, and requires quick response.
- OLTP Complex Transactions: This template is suitable for online transaction systems with complex transactions, such as complex join calculations, subqueries, and batch processing jobs written in PL. It also supports long and large transactions. If the instance is dedicated to OLTP workloads, we recommend that you optimize the large query strategy
large_query_thresholdfor the instance parameter from the default 600s to 5s. - HTAP Mixed Workloads: This template is suitable for hybrid workloads that run both transactions and online analytics. In addition to providing OLTP capabilities, it enhances the analytical capabilities in online analytics scenarios through vectorized execution.
- OLAP Online Analytics: This template is suitable for real-time data warehousing scenarios in online analytics. By default, tables created in this mode use columnar storage format and an optimized vectorized engine to improve analytical capabilities in complex analytical scenarios. If the instance is dedicated to online analytical workloads, we recommend that you optimize system variables and instance parameters. For example, you can enable adaptive parallel computation, optimize SQL sorting memory space, and set SQL and transaction timeouts and large query strategies. In addition, we recommend that you set the tenant character set to
utf8mb4_bin.
Number of Resource Units A resource unit is a collection of physical resources such as CPU, memory, storage space, and IOPS. OceanBase Database manages physical resources by resource units. If each resource unit contains three nodes, each additional resource unit adds three more nodes. Unit Specification The resource unit specification specifies the CPU cores and memory size for a single tenant on a single node. Note
- The total CPU cores and memory size of all tenants cannot exceed the specifications of the instance.
- Total resources available to a tenant = Single-node resources × Number of resource distribution nodes × Number of replicas
- In the current version, only instances purchased through Alibaba Cloud, Huawei Cloud, and AWS support configuring the maximum available IOPS.
Character Set Select a character set for the database. - MySQL-compatible tenants support the following character sets: utf8mb4, utf16, gbk, gb18030, and binary.
- Oracle-compatible tenants support the following character sets: utf8 and gbk.
Table Name Case Sensitivity Specifies whether the name of a table is case-sensitive. Note
This parameter is only available when Compatibility Mode is set to MySQL Compatible. The default setting is not case-sensitive.
Time Zone The time zone. Primary Zone The primary zone of the tenant. Multiple primary zones are supported. Network Settings If you enable this parameter, a public IP address will be created synchronously. Remarks (optional) The length of the remarks cannot exceed 30 characters. Click Create. You can view the tenant creation progress on the instance list page.