- What's New
- Function Overview
- Product Bulletin
- Service Overview
- Billing
- Getting Started
-
Kernel
- TaurusDB Kernel Version Release History
-
Common Kernel Functions
- Parallel Query
- Near Data Processing
- DDL Optimization
- Fast Binlog Positioning
- Backward Index Scan
- Statement Outline
- Idle Transaction Disconnection
- LIMIT...OFFSET Pushdown
- Conversion of IN Predicates Into Subqueries
- DISTINCT Optimization for Multi-Table Joins
- Diagnosis on Large Transactions
- Enhanced Partitioned Tables
- Hot Row Update
- Multi-tenancy
- Column Compression
- Table Recycle Bin
- Cold Data Preloading for Read Replicas
- Self-Healing of Read Replicas upon a Replication Latency
-
User Guide
- Permissions Management
- Buying a DB Instance
- Connecting to a DB Instance
- Database Usage
- Data Migration
-
Instance Management
- Viewing the Overall Status of DB Instances
- Viewing Metrics
- Instance Lifecycle Management
-
Configuration Changes
- Changing the vCPUs and Memory of a DB Instance or Node
- Changing the Storage Space of a DB Instance
- Configuring Auto Scaling Policies for a DB Instance
- Changing the Maintenance Window of a DB Instance
- Customizing Displayed Items of the Instance List
- Upgrading the Minor Kernel Version of a DB Instance
- Updating the OS of a DB Instance
- Data Backups
- Data Restorations
- Serverless Instances
- Multi-primary Instances (OBT)
- Read Replicas
-
Database Proxy (Read/Write Splitting)
- What Is Database Proxy?
- Creating a Proxy Instance for Read/Write Splitting
-
Changing Configurations of a Proxy Instance
- Changing the Consistency Level of a Proxy Instance
- Enabling the Connection Pool for a Proxy Instance
- Enabling Transaction Splitting for a Proxy Instance
- Modifying the Routing Policy of a Proxy Instance
- Changing Read Weights of Nodes
- Changing the Multi-statement Processing Mode of a Proxy Instance
- Enabling Automatic Association of New Nodes with a Proxy Instance
- Enabling Access Control for a Proxy Instance
- Changing the Specifications of a Proxy Instance
- Changing the Number of Nodes for a Proxy Instance
- Applying for a Private Domain Name for a Proxy Instance
- Changing the Port of a Proxy Instance
- Changing the Proxy Address of a Proxy Instance
- Modifying Parameters of a Proxy Instance
- Binding an EIP to a Proxy Instance
- Proxy Instance Lifecycle
- Proxy Instance Kernel Versions
- Using Hints for Read/Write Splitting
- DBA Assistant
- Parameter Management
- Security and Encryption
- Cold and Hot Data Separation (OBT)
- Application Lossless and Transparent (ALT)
-
HTAP Analysis (Standard Edition)
- What Is HTAP of Standard Edition?
- Connecting to an HTAP Instance for Complex OLAP Queries
- Connecting to a Standard HTAP Instance
-
Standard HTAP Instance Management
- Rebooting a Standard HTAP Instance
- Rebooting a Node of a Standard HTAP Instance
- Changing Storage Space of a Standard HTAP Instance
- Adding Read Replicas to a Standard HTAP Instance
- Deleting a Standard HTAP Instance
- Adjusting Blacklisted or Whitelisted Tables of a Standard HTAP Instance and Repairing Tables
- Standard HTAP Account Management
- Viewing Metrics of a Standard HTAP Instance or Nodes
- Syntax and Data Type Mappings Between HTAP and TaurusDB Instances
- Performance Tuning
-
RegionlessDB Clusters (OBT)
- What Is a RegionlessDB Cluster?
- Using a RegionlessDB Cluster for Remote Multi-Active DR
- Using a RegionlessDB Cluster for Remote DR
- Performing a Primary/Standby Switchover or Failover in a RegionlessDB Cluster
- Removing a Standby Instance from a RegionlessDB Cluster
- Deleting a RegionlessDB Cluster
- Viewing the Replication Latency and Traffic of a RegionlessDB Cluster
- Monitoring and Alarms
- Logs and Auditing
- Task Center
- Tag Management
- Quota Management
- Best Practices
- Performance White Paper
-
API Reference
- Before You Start
- API Overview
- Calling APIs
-
APIs (Recommended)
- DB Engine Version Queries
- Database Specification Queries
-
Instance Management
- Creating a DB Instance
- Rebooting a DB Instance
- Deleting/Unsubscribing from a DB Instance
- Creating a Read Replica
- Deleting or Unsubscribing from a Read Replica
- Scaling up Storage of a Yearly/Monthly DB Instance
- Changing a DB Instance Name
- Resetting a Database Password
- Changing DB Instance Specifications
- Querying Dedicated Resource Pools
- Querying Dedicated Resources
- Configuring the Monitoring By Seconds Function
- Querying the Configuration of Monitoring by Seconds
- Rebooting a Node
- Upgrading the Kernel Version of a DB Instance
- Enabling or Disabling SSL
- Binding an EIP
- Unbinding an EIP
- Promoting a Read Replica to Primary
- Changing a Maintenance Window
- Changing a Security Group
- Changing a Private IP Address
- Changing a Database Port
- Changing a DB Instance Description
- Applying for a Private Domain Name
- Changing a Private Domain Name
- Querying the Kernel Version
- Modifying Auto Scaling Policies
- Querying Auto Scaling Policies
- Pre-Checking Resources
- Querying DB instances
- Querying Details of a DB Instance
- Querying Details of DB Instances in Batches
- Modifying a Recycling Policy
- Querying a Recycling Policy
- Querying Instances in the Recycle Bin
- Changing Node Names in Batches
- Querying Historical Records of Auto Scaling
- Setting a Policy for a Serverless DB Instance
- Changing the Failover Priority of a Read Replica
- Querying an EIP
-
Backup Management
- Configuring a Same-Region Backup Policy
- Creating a Manual Backup
- Querying Full Backups
- Querying an Automated Backup Policy
- Deleting a Manual Backup
- Restoring Data to the Original Instance or an Existing Instance
- Querying the Restoration Time Range
- Enabling or Disabling Encrypted Backup
- Checking Whether Encrypted Backup Is Enabled
- Querying Incremental Backups
- Configuring a Cross-Region Backup Policy
- Restoring Tables to a Specified Point in Time
- Querying Tables for Table-level Point-in-Time Recovery
-
Parameter Template Management
- Querying Parameter Templates
- Creating a Parameter Template
- Deleting a Parameter Template
- Obtaining Details About a Parameter Template
- Modifying Parameters in a Parameter Template
- Applying a Parameter Template
- Replicating a Parameter Template
- Comparing Parameter Templates
- Querying Instances That a Parameter Template Can Be Applied To
- Viewing Parameter Change History
- Obtaining Parameter Information of a Specified DB Instance
- Modifying Parameters of a Specified DB Instance
- Replicating the Parameter Template of a DB Instance
- Querying Application Records of a Parameter Template
- Quota Management
-
Database Proxy
- Creating a Proxy Instance
- Deleting a Proxy Instance
- Querying Proxy Instances
- Querying Proxy Instance Specifications
- Adding Proxy Nodes
- Deleting Proxy Nodes
- Changing the Specifications of a Proxy Instance
- Assigning Read Weights
- Changing the Routing Policy of a Proxy Instance
- Enabling or Disabling Transaction Splitting for a Proxy Instance
- Enabling or Disabling Automatic Association of New Nodes with Proxy Instances
- Changing Session Consistency of a Proxy Instance
- Changing the Connection Pool Type of a Proxy Instance
- Changing the Port of a Proxy Instance
- Upgrading the Kernel Version of a Proxy Instance
- Modifying the Name of a Proxy Instance
- Querying Access Control Settings of a Proxy Instance
- Querying the Minor Version of a Proxy Instance
- Modifying Parameters of a Proxy Instance
- Querying Kernel Parameters of a Proxy Instance
- Enabling or Disabling Access Control
- Configuring Access Control Rules
- Enabling or Disabling SSL for a Proxy Instance
- Rebooting a Proxy Instance
-
Log Management
- Enabling or Disabling SQL Explorer
- Querying Whether SQL Explorer Is Enabled
- Querying Slow Query Logs
- Querying Error Logs
- Obtaining the Temporary Link for Downloading Full SQL
- Querying LTS Configurations of an Instance
- Deleting LTS Configurations in Batches
- Creating LTS Configurations in Batches
- Querying Whether Show Original Log Is Enabled
- Enabling or Disabling Show Original Log
- Querying Slow Query Log Statistics
- Obtaining Links for Downloading Slow Query Logs
- Tag Management
- Database User Management
- Database Management
- Traffic Management
- Task Center
- Intelligent Diagnosis
-
HTAP (Standard Edition)
- Restoring a Data Synchronization Task for a StarRocks Instance
- Stopping a Data Synchronization Task for a StarRocks Instance
- Checking Table Configurations for HTAP Data Synchronization
- Creating a StarRocks Instance
- Querying a StarRocks Instance
- Deleting a StarRocks Instance
- Rebooting a StarRocks Instance
- Rebooting a StarRocks Node
- Checking StarRocks Resources
- Querying HTAP Engine Resources
- Obtaining the Storage Type of an HTAP Instance
- Querying Specifications of an HTAP Instance
- Querying HTAP Instances
- Creating a Data Synchronization Task for a StarRocks Instance
- Deleting a Data Synchronization Task for a StarRocks Instance
- Querying Data Synchronization Tasks of a StarRocks Instance
- Checking Database Configurations for HTAP Data Synchronization
- Querying Configurations of a StarRocks Data Synchronization Task
- Querying Database Parameter Settings for StarRocks Data Synchronization
- Querying Databases of a StarRocks Instance
- Querying Database Accounts
- Creating a Database Account
- Deleting a Database Account
- Changing the Password of a Database Account
- Changing Permissions of a Database Account
- Changing the Specifications of a StarRocks Instance
- Querying Parameters
- Modifying Parameters
- Enabling Assign Requests to Row and Column Store Nodes for a StarRocks Instance
- Comparing Parameters
- Multi-tenancy
-
APIs (Unavailable Soon)
- DB Engine Version Queries
- Database Specification Queries
-
Instance Management
- Creating a DB Instance
- Querying DB Instances
- Querying DB Instances
- Deleting a DB Instance
- Querying Details of a DB Instance
- Querying Details of DB Instances in Batches
- Querying Details of a DB Instance
- Creating a Read Replica
- Deleting a Read Replica
- Scaling up Storage of a Yearly/Monthly DB Instance
- Changing a DB Instance Name
- Resetting a Database Password
- Modifying DB Instance Specifications
- Backup Management
- Parameter Template Management
- Quota Management
- Database Proxy
- Log Management
- Task Information Queries
- Permissions Policies and Supported Actions
- Appendix
- SDK Reference
-
FAQs
- Product Consulting
- Resource Freezing, Unfreezing, Release, Deletion, and Unsubscription
-
Database Connections
- What Should I Do If I Can't Connect to My TaurusDB Instance?
- What Should I Do If an ECS Can't Connect to a TaurusDB Instance?
- Can an External Server Access a TaurusDB Instance?
- What Is the Maximum Number of Connections to a TaurusDB Instance?
- What Do I Do If There Are Too Many Database Connections?
- Are There Any Risks If There Are Too Many Connections to a TaurusDB Instance?
- What Should I Do If the Network Connectivity Test Fails?
- Can I Access a TaurusDB Instance over an Intranet Connection Across Regions?
- How Do I Check the Connections to a TaurusDB Instance?
- How Do I Enable Availability Detection for a Connection Pool in the Service Code?
- Client Installation
- Database Migration
- Database Permissions
-
Database Performance
- What Should I Do If the CPU Usage of My TaurusDB Instance Is High?
- How Do I Handle Slow SQL Statements Caused by Inappropriate Composite Index Settings?
- How Do I Handle a Large Number of Temporary Tables Being Generated for Long Transactions and High Memory Usage?
- What Should I Do If Locks on Long Transactions Block the Execution of Subsequent Transactions?
- How Can I Use Temporary Disks of TaurusDB?
- What Is the CPU Usage of a TaurusDB Instance with Empty Load?
-
Database Usage
- Why Are the Results Inconsistent After the MATCH AGAINST Statement Is Executed, Respectively, on Primary Nods and Read Replicas?
- How Do I Add Columns Using INSTANT?
- How Do I Use LOAD DATA to Import Local Data?
- How Do I Write Data to or Create Indexes for an Ultra-large Table?
- What Are the Risks of Deleting an Index from an Ultra-large Table?
- Backups
-
Database Parameter Modification
- How Do I Change the Time Zone of a TaurusDB Instance?
- How Do I Configure a Password Expiration Policy for TaurusDB Instances?
- How Do I Ensure that the Database Character Set of a TaurusDB Instance Is Correct?
- How Do I Use the utf8mb4 Character Set to Store Emojis in a TaurusDB Instance?
- How Do I Set Case Sensitivity for TaurusDB Table Names?
- Can I Use SQL Commands to Modify Global Parameters of My TaurusDB Instance?
- Network Security
-
Log Management
- Can I Enable general_log for TaurusDB?
- How Do I View All SQL Statements Executed by TaurusDB?
- How Do I Enable and View Binlog of My TaurusDB Instance?
- How Do I Change the Binlog Retention Period?
- How Do I View Deadlock Logs of TaurusDB?
- Why Are Slow SQL Statements Displayed in Slow Query Log Monitoring, but No Information About Them Is Displayed on the Slow Query Logs Tab Page in the Logs Module?
- Version Upgrade
-
Troubleshooting
-
Backup and Restoration Issues
- Insufficient Permissions During Data Export Using mysqldump
- How Do I use mysqlbinlog to Obtain Binlog Files?
- Canal Fails to Parse Binlogs
- Precautions for Exporting Large Tables Through mysqldump
- Commands for Exporting Data Through mysqldump
- System Inaccessible After Field Addition to a Database Table
- SQL Statements Such as SET @@SESSION.SQL_LOG_BIN Displayed After You Run mysqldump
- Insufficient Privileges Reported for Canal
-
Connection Issues
- Login Failed After ssl_type of root Is Changed to ANY
- Failed to Connect to a DB Instance Using SSL
- Description of Each IP Address
- SSL Connection Failed Due to Inconsistent TLS Versions
- Error Message "connection established slowly"
- "Access denied" Displayed During Database Connection
- Failed to Connect to a Database Using mariadb-connector in SSL Mode
- Failed to Connect to a Database as User root
- Client Automatically Disconnected from a DB Instance
- Disconnection Occurs Every 45 Days Due to the istio-citadel Certificate Mechanism
-
SQL Issues
- Invalid TIMESTAMP Default Value during Table Creation
- Failed to Change the VARCHAR Length Due to the Index Length Limit
- Slow SQL Queries After a Large Amount of Data Is Deleted from a Large Table
- Error 1366 Reported When Data Containing Emojis Is Updated
- Slow Stored Procedure Execution Due to Inconsistent Collations
- ERROR [1412] Reported for a DB Instance
- Failed to Delete a Table with a Foreign Key
- Incorrect GROUP_CONCAT Results
- Error Message "Too many keys specified" Displayed When a Secondary Index Is Created
- DISTINCT and GROUP BY Optimization
- Equivalent Comparison Failures with Floating-Point Numbers
- A Large Number of SELECT Requests Routed to The Primary Instance After Database Proxy Is Enabled
- Tablespace Bloat
- ERROR 1396 Reported When a User Is Created
- Error Message Reported When alter table xxx discard/import tablespace Is Executed
- Native Error 1461 Reported by a DB Instance
- "Row size too large" Reported When a Table Failed to Be Created
- Duplicate Data Exists After ORDER BY LIMIT Is Executed
- Error Message Reported When select * from sys.innodb_lock_waits Is Executed
- Parameter-related Issues
-
Performance Issues
- High CPU Usage
- Out of Memory (OOM) Errors
- Tablespace Bloat
- Read Replica Uses Far More Storage Than the Primary Node
- Slow SQL Execution Due to Hot and Cold Data Problems
- Full Storage Caused by Complex Queries
- Slow Response Due to Deadlocks
- CPU Usage Increase
- CPU Resource Exhaustion Caused by Too Many Concurrent Slow Queries
-
Basic Issues
- How Do I View the Used Storage of My TaurusDB Instance?
- Renaming Databases and Tables
- Character Set and Collation Settings
- Auto-Increment Field Value Jump
- Starting Value and Increment of AUTO_INCREMENT
- Changing the AUTO_INCREMENT Value of a Table
- Failed to Insert Data Because Values for the Auto-increment Primary Key Field Reach the Upper Limit
- Auto-increment Field Values
- AUTO_INCREMENT Not Displayed in the Table Structure
- Impact of Creating an Empty Username
- No Scanned Rows Recorded in Slow Query Logs
- "handle_sync_msg_from_slave my_net_read error:-1" Displayed on the Error Logs Tab Page
- ERROR 1290 (HY000): The MySQL server is running with the --sql-replica-on option so it cannot execute this statement
-
Backup and Restoration Issues
- Videos
- General Reference
Show all
Copied.
Using a RegionlessDB Cluster for Remote Multi-Active DR
Scenarios
If your workloads are deployed in multiple regions, you can create a RegionlessDB cluster to access databases from the nearest region. As shown in Figure 1, a RegionlessDB cluster contains a primary instance and two standby instances. Read requests are sent to a standby instance in the nearest region, and write requests are automatically forwarded from the nearest region to the primary instance. After data is written to the primary instance, the data is synchronized to all standby instances, reducing the cross-region network latency.
Constraints
For details, see Constraints.
Procedure
Step 1: Create a RegionlessDB Cluster
- Log in to the management console.
- Click
in the upper left corner and select a region and project.
- Click
in the upper left corner of the page and choose Databases > TaurusDB.
- On the RegionlessDB page, click Create RegionlessDB in the upper right corner.
Figure 2 Creating a RegionlessDB cluster
- In the Create RegionlessDB dialog box, configure RegionlessDB Name, Primary Instance Region, and Primary Instance.
Figure 3 Configuring the RegionlessDB cluster information
Table 1 Parameter description Parameter
Description
RegionlessDB Name
The name must start with a letter and consist of 4 to 64 characters. Only letters (case-sensitive), digits, hyphens (-), and underscores (_) are allowed.
Primary Instance Region
Select a region where the primary instance is located.
Primary Instance
Select an existing DB instance as the primary instance of the RegionlessDB cluster.
- Click OK.
- After the primary instance is created, view and manage it.
During the creation process, the instance status is Creating. To view the detailed progress and result of the creation, go to the Task Center page. After the status of the primary instance is Available, you can use the instance.
Step 2: Add a Standby Instance
- On the RegionlessDB page, locate the RegionlessDB cluster.
- Click Add Standby Instance in the Operation column.
Figure 4 Adding a standby instance
- On the displayed page, configure related parameters.
Table 2 Basic information Parameter
Description
Region
Region where the standby instance is deployed.
NOTICE:Products in different regions cannot communicate with each other through a private network. After a DB instance is purchased, the region cannot be changed.
Creation Method
Create new
DB Instance Name
The name must start with a letter and consist of 4 to 64 characters. Only letters, digits, hyphens (-), and underscores (_) are allowed.
DB Engine
TaurusDB
DB Engine Version
MySQL 8.0
Kernel Version
Kernel version of the standby instance. The kernel version must be 2.0.46.231000 or later.
For details about the updates in each minor kernel version, see TaurusDB Kernel Version Release History.
NOTE:
To specify this parameter, submit a request by choosing Service Tickets > Create Service Ticket in the upper right corner of the management console.
DB Instance Type
Only Cluster can be selected. There are 2 to 10 read replicas in a cluster instance in the RegionlessDB cluster.
Storage Type
Shared
AZ Type
An AZ is a physical region where resources have their own independent power supply and networks. AZs are physically isolated but interconnected through an internal network. Some regions support both single-AZ and multi-AZ deployment and some only support single-AZ deployment.
- Single AZ: The primary node and read replicas are deployed in the same AZ.
- Multi-AZ: The primary node and read replicas are deployed in different AZs to ensure high reliability.
Time Zone
You need to select a time zone for your instance based on the region hosting your instance. The time zone is selected during instance creation and cannot be changed after the instance is created.
Instance Specifications
For details about the specifications supported by TaurusDB, see Instance Specifications.
TaurusDB is a cloud-native database that uses the shared storage. To ensure workload stability in high read/write pressure, the system controls the read/write peaks of DB instances based on instance specifications. For details about how to select specifications, see Performance White Paper.
CPU Architecture
The CPU architecture can be x86 or Kunpeng. Under a CPU architecture, you need to select vCPUs and memory of the instance.
Nodes
All nodes of the standby instance are read replicas. You can apply for a maximum of 10 read replicas at a time for a pay-per-use instance.
After an instance is created, you can add read replicas as required. Up to 15 read replicas can be created for a standby instance in a cluster.
Storage
Storage will be scaled up dynamically based on the amount of data that needs to be stored, and is billed hourly on a pay-per-use basis.
VPC
- A dedicated virtual network in which your TaurusDB instance is located. It isolates networks for different workloads. You can select an existing VPC or create a VPC. For details about how to create a VPC, see Creating a VPC.
If no VPC is available, TaurusDB allocates a VPC to you by default.
NOTICE:- Ensure that the VPC selected for the standby instance is connected to the VPC selected for the primary instance through a VPN.
- After a TaurusDB instance is created, the VPC cannot be changed.
- A subnet provides dedicated network resources that are logically isolated from other networks for network security.
A private IP address is automatically assigned when you create a DB instance. You can also enter an idle private IP address in the subnet CIDR block.
Security Group
It can enhance security by controlling access to TaurusDB from other services. When you select a security group, you must ensure that it allows the client to access instances.
If no security group is available or has been created, TaurusDB allocates a security group to you by default.
NOTE:
- To ensure subsequent database connection and access, you need to allow all IP addresses to access your DB instance through port 3306 and over ICMP.
- Configure private network security group rules to ensure that the primary and standby instances in a cluster can communicate with each other.
Parameter Template
Contains engine configuration values that can be applied to one or more instances. You can modify the instance parameters as required after the instance is created.
NOTICE:If you use a custom parameter template when creating a DB instance, the following specification-related parameters in the custom template are not applied. Instead, the default values are used.
innodb_buffer_pool_size
innodb_log_buffer_size
max_connections
innodb_buffer_pool_instances
innodb_page_cleaners
innodb_parallel_read_threads
innodb_read_io_threads
innodb_write_io_threads
threadpool_size
After a DB instance is created, you can adjust its parameters as needed. For details, see Modifying Parameters in a Parameter Template.
Enterprise Project
This parameter is for enterprise users. To specify it, submit a request by choosing Service Tickets > Create Service Ticket in the upper right corner of the management console.
An enterprise project provides a way to manage cloud resources and enterprise members on a project-by-project basis.
You can select an enterprise project from the drop-down list. The default project is default.
Tag
This parameter is optional. Adding tags helps you better identify and manage your DB instances. Each DB instance can have up to 20 tags.
After a DB instance is created, you can view its tag details on the Tags tab. For details, see Tag Management.
NOTE:
The instance password and table name case sensitivity are the same as those of the primary instance. You do not need to set them separately.
- Click Next.
- Confirm the information and click Submit.
- Go to the Instances page to view and manage the instance.
During the creation process, the instance status is Creating. To view the detailed progress and result of the creation, go to the Task Center page. After the status of the instance is Available, you can use the instance.
NOTE:
If there is a large amount of data in the primary instance, it may take a long time to complete a full backup during standby instance creation.
Step 3: Enable Write Forwarding
In normal cases, after a RegionlessDB cluster is created, the primary instance receives and processes read and write requests, and standby instances receive only read requests. After write forwarding is enabled, standby instances can receive write requests and then forward them to the primary instance for processing. After data is written to the primary instance, the data is synchronized to all standby instances. Write forwarding simplifies the data write process. You can directly connect a database service through a standby instance's IP address to perform read and write operations. In addition, consistency is ensured and the nearby read is not affected.
- Write forwarding is only available when the transaction isolation level of the standby instances is RR.
- In the current version, WARNING and RECORD information cannot be displayed when a standby instance forwards write requests.
- In the current version, SQL requests that are being executed cannot be interrupted when a standby instance forwards write requests.
- When write forwarding is enabled, user _@gdb_WriteForward@_ is created. Do not modify or delete the user, or write forwarding cannot run properly.
- The following commands are supported for write forwarding:
- SQLCOM_UPDATE
- SQLCOM_INSERT
- SQLCOM_DELETE
- SQLCOM_INSERT_SELECT
- SQLCOM_REPLACE
- SQLCOM_REPLACE_SELECT
- SQLCOM_DELETE_MULTI
- SQLCOM_UPDATE_MULTI
- SQLCOM_ROLLBACK
If an unsupported command is executed, the following error information is displayed.ERROR xxx (yyy): This version of MySQL doesn't yet support 'operation with write forwarding'.
operation indicates the operation type that is not supported.
- The following scenarios are not supported:
- There are SELECT FOR UPDATE statements.
- There are EXPLAIN write forwarding statements.
- The statements for write forwarding contain SET VARIABLE.
- SAVEPOINT is not supported when write forwarding is enabled.
- Write forwarding is not supported in XA transactions.
- Currently, START TRANSACTION READ WRITE is not supported. You can directly use START TRANSACTION to test write forwarding.
- Write forwarding is not supported in stored procedures.
- When write forwarding is enabled, temporary tables cannot be created. To create temporary tables, disable write forwarding temporarily.
- For commands that can be implicitly committed, if write forwarding is not supported, the transactions corresponding to the current node and primary node are automatically committed.
- For the global consistency level, before accessing data for the first time, each transaction needs to use a connection in the session pool to obtain a data point (LSN) from the primary node. If no sessions are available, the command for reading data may fail.
- If there is a connection error when a user uses a session for write forwarding and the user is in a multi-statement transaction, the server proactively closes the connections to the client and the primary node, ensuring that the client can detect the error.
- The versions of the primary and standby instances must be the latest.
- Write operations are finally forwarded to and processed by the primary node. If a temporary table with the same name exists in the given database of the primary and read replicas, the data on the primary node is used.
- If there is a primary/standby switchover or failover for a standby instance in a RegionlessDB cluster, the write forwarding parameters (rds_open_write_forwarding and rds_write_forward_read_consistency) are restored to the default values.
- On the RegionlessDB page, locate the RegionlessDB cluster.
- Click Set Write Forwarding in the Operation column to create a write forwarding account.
Figure 5 Creating a write forwarding account
NOTE:
The system automatically creates an internal account (_@gdb_WriteForward@_) so that write requests can be forwarded to the primary instance for processing. You cannot modify or delete the internal account, or write forwarding will be affected.
- In the Set Write Forwarding dialog box, confirm the information and click OK.
Figure 6 Setting write forwarding
- On the Instances page, click the name of the standby instance in the RegionlessDB cluster.
- In the navigation pane, choose Parameters.
- Search for rds_open_write_forwarding in the upper right corner of the Parameters page and change its value to ON.
- Click Save in the upper left corner to enable write forwarding.
- Search for rds_write_forward_read_consistency in the upper right corner of the Parameters page and change the read consistency level of write forwarding.
You can modify the parameters to set the read consistency range. For details, see Table 3.
Table 3 Parameter description Parameter
Description
NONE
Write forwarding is disabled.
EVENTUAL
Results of write operations are not visible until the write operations are performed on the primary instance. The query does not wait for data synchronization between primary and standby instances to complete, so data that is not updated may be read.
SESSION
All queries executed by a standby instance with write forwarding enabled see the results of all data writes performed in this session. The queries wait for the results of forwarded write operations to be replicated.
GLOBAL
A session can view all committed changes of all sessions and instances in a RegionlessDB cluster. The query may wait for a certain period, which is related to the replication latency.
NOTE:
- If read consistency is required, you are advised to set the consistency level to SESSION. The consistency level GLOBAL will cause a large extra cost for all read requests. For example, if any client is used to connect to TaurusDB and the GLOBAL level is used, the time for accessing the MySQL command line is prolonged.
- The read consistency level in write forwarding cannot be changed to SESSION in a transaction.
- Before enabling write forwarding, ensure that the transaction isolation levels of standby instances are RR.
- When write forwarding is enabled, the transaction isolation level of the current session cannot be changed.
- The read consistency level cannot be changed in a transaction.
- Click Save in the upper left corner.
Step 4: Connect to the RegionlessDB Cluster for Service Management
After a RegionlessDB cluster is created, no unified connection address is provided. The primary and standby instances in the RegionlessDB cluster provide independent connection addresses. You can use the nearest primary or standby instance based on the service access region to connect to the RegionlessDB cluster. The RegionlessDB cluster automatically forwards write requests to the primary instance for processing and read requests to the instance of the nearest region for processing.
- Connect to the primary instance and write data to the database.
mysql> CREATE DATABASE mydatabase; mysql> CREATE TABLE orders (order_id INT PRIMARY KEY, customer_name VARCHAR(255), order_date DATE); mysql> INSERT INTO orders (order_id, customer_name, order_date) VALUES (1, 'UserA', '2023-12-18'), (2, 'UserB', '2023-12-17'), (3, 'UserC', '2023-12-16');
- Use the nearest standby instance to access the database and query the data written in 1.
mysql> select * from mydatabase.orders; +----------+---------------+------------+ | order_id | customer_name | order_date | +----------+---------------+------------+ | 1 | UserA | 2023-12-18 | | 2 | UserB | 2023-12-17 | | 3 | UserC | 2023-12-16 | +----------+---------------+------------+
- Connect to database through the primary instance and run the following SQL statements to create the mydatabase database and orders table.
mysql> CREATE DATABASE mydatabase; Query OK, 1 row affected (0.00 sec) mysql> USE mydatabase; Database changed mysql> CREATE TABLE orders (order_id INT PRIMARY KEY, customer_name VARCHAR(255), order_date DATE); Query OK, 0 rows affected (0.01 sec)
- Connect to the database from a standby instance, run the following SQL statements to write three data records to the orders table, and query the written data.
mysql> INSERT INTO orders (order_id, customer_name, order_date) VALUES (1, 'UserA', '2023-12-18'), (2, 'UserB', '2023-12-17'), (3, 'UserC', '2023-12-16'); Query OK, 3 rows affected (0.00 sec) mysql> SELECT * FROM mydatabase.orders; +----------+---------------+------------+ | order_id | customer_name | order_date | +----------+---------------+------------+ | 1 | UserA | 2023-12-18 | | 2 | UserB | 2023-12-17 | | 3 | UserC | 2023-12-16 | +----------+---------------+------------+ 3 rows in set (0.01 sec)
- Connect to the database through the primary instance and run the following SQL statements to query the data inserted by the standby instance in 4.
mysql> SELECT * FROM mydatabase.orders; +----------+---------------+------------+ | order_id | customer_name | order_date | +----------+---------------+------------+ | 1 | UserA | 2023-12-18 | | 2 | UserB | 2023-12-17 | | 3 | UserC | 2023-12-16 | +----------+---------------+------------+ 3 rows in set (0.00 sec)
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot