Help Center/ TaurusDB/ User Guide/ Application Lossless and Transparent (ALT)/ Overview of Application Lossless and Transparent (ALT)
Updated on 2026-11-03 GMT+08:00

Overview of Application Lossless and Transparent (ALT)

Scenarios

When a DB instance undergoes a specification change (at the instance or node level), read replica promotion, or a minor version upgrade, user sessions may be interrupted. In such cases, applications must detect session changes and implement complex recovery measures, such as determining whether database connections or transactions have been interrupted, performing transaction compensation, and rebuilding database session contexts.

To address these issues, TaurusDB provides Application Lossless and Transparent (ALT), which includes read/write ALT and read-only ALT. During database system switchover, ALT prevents database connections and transactions from being interrupted. Applications do not need to perform transaction compensation or restore and rebuild session contexts, thereby ensuring seamless application continuity and uninterrupted workloads.

ALT operates at the user connection level. Users can connect to a database through a database proxy instance. During a specification change, read replica promotion, or minor version upgrade, the system replicates the backend sessions for user connections. Once a safe transaction boundary is reached, the session operation contexts are fully cloned to the target nodes, ensuring uninterrupted workloads.

Basic Concepts

Table 1 Basic concepts

Concept

Description

Secure transaction boundary

The state after the transaction on the current session has been committed and before the next transaction begins.

Examples:

  • For transactions with autocommit enabled, a transaction boundary is reached after each statement is executed.
    start transaction;
    DML; 
    commit;
  • When autocommit is disabled, a transaction boundary is reached after the COMMIT statement is executed.
  • A transaction boundary is reached after a standalone DML or DDL statement is executed.
  • When table locks, backup locks, or user-defined locks are used, a transaction boundary is reached after the locks are released.

Draining

ALT requires that no connection have an ongoing transaction. During a primary/standby switchover, the system must wait for ongoing transactions to complete. The time allowed for transactions to complete is called the draining timeout, which is controlled by the rds_tac_drain_timeout parameter. The default value is 5s, and the valid range is 1–60s.

If the workload is heavy, the number of prepared statements is large, or transactions take a long time to execute, you are advised to increase the timeout. Do not reduce it. If some connections still have ongoing transactions when the timeout expires, ALT will not be available for those connections.

How ALT Works

TaurusDB supports read/write ALT and read-only ALT.

Figure 1 Read/Write ALT architecture

Applications 1 and 2 connect to the database proxy instance through Connection 1 and Connection 2, respectively. The database proxy instance establishes session connections to the primary node and read replicas.

When an instance specification change (excluding specification changes for read replicas), read replica promotion, or minor version upgrade occurs, a switchover between the primary node and a read replica is required. The right side of the architecture diagram shows the state after the switchover:

  1. Before the switchover: The proxy instance establishes Session X1 and Session X2 connections to the primary node.
  2. During the switchover: The proxy instance establishes the same number of connections, Session Y1 and Session Y2, to the read replica. The proxy instance then transfers the workloads from the primary node to the read replica.
  3. After the switchover: The workloads on the original primary node are now running on the new primary node.
Figure 2 Read-only ALT architecture (specification change)

Applications 1 and 2 connect to the database proxy instance through Connection 1 and Connection 2, respectively. The database proxy instance establishes session connections to backend read replicas.

When an instance undergoes a specification change (at the instance or node level), a switchover between read replicas is required. The right side of the architecture diagram shows the state after the switchover:

  1. Before the switchover: The proxy instance establishes Session X1 and Session X2 connections to the old read replica.
  2. During the switchover: The proxy instance establishes the same number of connections, Session Y1 and Session Y2, to the new read replica. The proxy instance then transfers the workloads from the old read replica to the new read replica.
  3. After the switchover: Workloads on the old read replica are now running on the new read replica. The old read replica will be deleted after the specification change is complete.

Version Requirements and Constraints

Table 2 ALT version requirements

Feature

Version Requirements

Read/Write ALT

  • TaurusDB kernel version 2.0.54.240600 or later
  • Database proxy kernel version 2.24.06.000 or later

Read-only ALT

  • TaurusDB kernel version 2.0.54.240600 or later
  • Database proxy kernel version 2.26.03.000 or later

Constraints

  • The instance must have one primary node and at least one read replica. Database proxy must be enabled, and the instance must be accessed through the database proxy address.
  • ALT is not supported in read-only database proxy mode.
  • Instance-level ALT is not supported for single-node TaurusDB instances.
  • Read-only ALT is not supported for Serverless instances.
  • During an ALT switchover, the system temporarily creates the same number of standby connections on the target new primary node as there are connections on the original primary node. Ensure that the maximum total number of connections supported by the DB instance is at least twice the current number of connections. For read-only ALT, when a specification change is performed (at the instance or node level), you must also check the max_connections value for the new specification. Otherwise, the operation may fail with a "Too many connections" error.

    Before modifying the maximum number of connections, evaluate the instance specifications and memory usage. For details, see What Is the Maximum Number of Connections to a TaurusDB Instance?

  • To use ALT during an instance-level specification change, ensure that the maximum connection limit of the primary node is at least twice the current number of active connections. Before modifying the maximum number of connections, evaluate the instance specifications and memory usage. For details, see What Is the Maximum Number of Connections to a TaurusDB Instance?

    Some connections will be retained after the specification change is complete, depending on your configuration of the connection timeout parameter (wait_timeout, which specifies the number of seconds the server waits for activity on a non-interactive connection before closing it).

  • ALT supports the Prepare protocol. During a switchover, the context information for prepared statements is rebuilt. If the workload uses a large number of prepared statements, the switchover may be less likely to succeed. Ensure that max_prepared_stmt_count is set to at least twice the number of prepared statements. Before modifying max_prepared_stmt_count, evaluate the instance specifications and memory usage. For details, see Modifying Instance Parameters.

    Run the following SQL statement to query the number of prepared statements:

    show global status like 'prepared_stmt_count';
  • ALT switchovers are recommended during off-peak hours. Excessive workloads on the primary node and read replicas, or multiple specification changes within a short period, may reduce the switchover success rate.
  • For details about syntax and function constraints of proxy instances, see Precautions for TaurusDB Proxy Instances.

Unsupported Features

Table 3 Features not supported after ALT is enabled

Module

Description

User-defined system variables

  • innodb_ft_user_stopword_table: Only the value NULL is supported.
  • transaction_write_set_extraction: Only the value OFF is supported.
  • profiling: It cannot be set to 1 or ON.

Database proxy

  • Session-level connection pooling is not supported.
  • Global consistency is not supported.
  • Inserting more than 16 MB of data into a single column is not supported.
  • Query result sets larger than 16 MB are not supported.

Temporary tables

User temporary tables are not supported.

Secure transaction boundary

  • Long-running InnoDB transactions that are not committed are not supported.
  • Transactions with unreleased table locks, user locks, backup locks, or binlog locks (lock for backup/binlog) are not supported.
  • XA transactions are not supported.

Prepared statement migration

  • A prepared statement cannot be migrated if it has opened a cursor that has not been closed.
  • A prepared statement cannot be migrated if one of its variables has stored data of the LONG_DATA type.

Other features

Transparent Data Encryption (TDE) cannot be enabled.