All Products
Search
Document Center

ApsaraDB for OceanBase:Add an access address

Last Updated:Apr 25, 2024

This topic describes how to add an access address and perform other operations related to an access address.

Principles

ApsaraDB for OceanBase provides a network proxy layer between your database and applications. You can add a read-only address or read/write splitting address in the proxy layer to fully use the multi-replica capabilities of ApsaraDB for OceanBase, thereby improving the execution efficiency of your business system.

In ApsaraDB for OceanBase, read/write splitting means that the read and write operations are respectively processed by different nodes to improve the read/write performance and availability of the database. Write operations that usually involve data modifications and updates are performed on the primary node. This ensures data consistency and reliability and avoids data corruption and losses, thereby improving the security and stability of the database. Read operations that only access data replicas are distributed to multiple standby nodes to implement parallel processing and load balancing. This reduces the load and response time of the database, thereby improving user experience and satisfaction.

Concepts

  • Primary address: It supports data reads and writes with strong consistency. By default, data is read by using the primary address. When a tenant is created, the primary address is automatically created. By default, the primary address proxy is deployed in a primary zone.

  • Access address: It can be a read-only address or a read/write splitting address.

  • Read-only address: It supports only read operations. Read requests are sent to a follower of the full-featured replica to ensure final data consistency.

  • Read/Write splitting address: It supports both read and write operations. Write requests are sent to the leader of the full-featured replica, and read requests beyond the transaction are sent to followers to reduce load on the leader, ensuring final data consistency.

  • Direct connection address: It supports both read and write operations. By default, requests are directly forwarded to the leader.

    Note
    • Generally, the data accessed by using a read-only address lags less than 1s behind the data accessed by using the corresponding primary address.

    • We recommend that you use a primary address, read-only address, or read/write splitting address in a production environment.

    • At present, the direct connection address service is available only to users on the allowlist. To enable this service, contact ApsaraDB for OceanBase Technical Support.

Limitations

  1. The limitations on access addresses are as follows:

    • You cannot add an access address for a tenant in a standby instance.

    • In single-IDC deployment mode, only one primary address is supported at the proxy layer, and no access address can be added.

    • In dual-IDC deployment mode, only one primary address is supported at the proxy layer, and only one read-only or read/write splitting address can be added.

    • In multi-IDC deployment mode, only one primary address is supported at the proxy layer, and at most two read-only or read/write splitting addresses can be added. If you need more addresses, contact OceanBase Technical Support to apply for proxy resources of higher specifications.

  2. The limitations on direct connection addresses are as follows:

    • Direct connection addresses can be created only for a tenant of ApsaraDB for OceanBase V4.2.1.2 or later with only one resource unit.

    • At present, a direct connection address can be used for private network access.

Add an access address

  1. Log on to the ApsaraDB for OceanBase console.

  2. In the left-side navigation pane, click Instances.

  3. In the instance list, click the name of the target cluster instance to go to the Cluster Instance Workspace page.

  4. In the tenant list, click the name of the target tenant to go to the Tenant Workspace page.

  5. Click the More icon in the upper right corner, and select Add Access Address.

    Note

    If the number of access addresses for cluster replicas reaches the specified threshold, the Add Access Address button is unavailable.

    1

  6. Specify the type and zone of the address and click OK.

    Parameter

    Description

    Address Type

    The type of the address to be added. Valid values:

    • Read-only

    • Read/Write Splitting

    • Direct Connection

    Note
    • For a tenant in a Standard Edition (Key-Value) instance, you can add only one read-only address.

    Zone

    The zone of the address. To add a read-only address, specify the zone where the address resides. To add a read/write splitting address, specify the zone where the data accessed by read requests resides.

    • If you add a read-only or read/write splitting address, the address proxy and the accessed data are in the same zone, namely, the specified zone.

    • If you add a direct connection address, the address must be in the primary zone.

    Replica Type

    The type of replica that you want to add. Valid values:

    Query Optimization

    • Enabling parallel query (ePQ) can effectively utilize the parallel processing capability of multiple CPU cores to accelerate queries. The enabling and disabling of this feature take effect only for new connections. For more information, see Parallel query.

    • This setting has a higher priority than cluster parameters and can take effect even if the related cluster parameters are disabled.

    • Maximum degree of parallelism (DOP) = Number of CPU cores of the tenant × Number of nodes × 1.5. The numeric values in this formula must be positive integers and cannot be left empty.

    VPC ID

    By default, the virtual private cloud (VPC) ID of the tenant is displayed. We recommend that you use the VPC where your business or application resides to effectively reduce the access latency.

    If no suitable VPC is available, create a VPC as prompted. For more information, see What is a VPC.

    vSwitch

    By default, the vSwitch ID of the tenant is displayed. You can select another vSwitch ID as needed or create a vSwitch and select its ID in the console.

    High Availability

    The default value is Primary/Standby High-Availability Mode. When the read-only zone fails, the system switches to another zone.

    Consistency Level

    The default value is Eventual Consistency. Data replication latency exists between a read-only zone and a primary zone. This may cause a time difference in the query result between the read-only zone and the primary zone. The query result is determined by the replication latency. However, the data is eventually consistent.

What to do next

Enable public IP addresses

ApsaraDB for OceanBase allows you to enable public IP addresses for primary addresses of tenant instances and serverless instances. The following procedure takes a tenant instance as an example:

  1. Log on to the ApsaraDB for OceanBase console.

  2. In the left-side navigation pane, click Instances.

  3. In the instance list, click the name of the target cluster instance to go to the Cluster Instance Workspace page.

  4. In the left-side navigation pane, click Tenant Management.

  5. In the tenant list, click the name of the target tenant to go to the Tenant Workspace page.

  6. In the Deployment Diagram section, click Enable on the primary address card.

  7. In the dialog box that appears, click OK.

  8. After the public IP address is enabled, you need to add it to the allowlist. For more information, see Create an allowlist.

Delete an access address

  1. Log on to the ApsaraDB for OceanBase console.

  2. In the left-side navigation pane, click Instances.

  3. In the instance list, click the name of the target cluster instance to go to the Cluster Instance Workspace page.

  4. In the left-side navigation pane, click Tenant Management. The Tenant Management page appears.

  5. In the tenant list, click the name of the target tenant to go to the Tenant Workspace page.

  6. Move the pointer over the target address card in the Deployment Diagram section.

  7. Click image in the upper-right corner of the card.

    Note

    After an access address is deleted, the related service becomes unavailable. Before you delete an access address, make sure that all access requests to the address are stopped.

View proxy address information

  • After you add an access address or direct connection address, you can view the address information in the Deployment Diagram section of the tenant workspace. Move the pointer over the access address or direct connection address card to view the complete private network address. The Set and Delete icons appear in the upper-right corner. You can click the Set icon to modify the settings of the access address or direct connection address, and click the Delete icon to delete the address.

  • You can click the Edit icon next to a private network address to modify the address.