Azure Database for MariaDB 中的高可用性概念High availability concepts in Azure Database for MariaDB

Azure Database for MariaDB 服务提供有保证的高级别可用性。The Azure Database for MariaDB service provides a guaranteed high level of availability. 有资金支持的服务级别协议 (SLA) 在正式版本发布后的可用性为 99.99%。The financially backed service level agreement (SLA) is 99.99% upon general availability. 使用此服务期间,几乎没有应用程序故障时间。There is virtually no application down time when using this service.

高可用性High availability

高可用性 (HA) 模型以节点级中断发生时的内置故障转移机制为依据。The high availability (HA) model is based on built-in fail-over mechanisms when a node-level interruption occurs. 硬件故障或响应服务部署都有可能会导致节点级中断发生。A node-level interruption could occur because of a hardware failure or in response to a service deployment.

在任何时候,对 Azure Database for MariaDB 数据库服务器做出的更改都发生在事务的上下文中。At all times, changes made to an Azure Database for MariaDB database server occur in the context of a transaction. 更改会在事务提交时同步记录到 Azure 存储中。Changes are recorded synchronously in Azure storage when the transaction is committed. 如果发生节点级中断,数据库服务器会自动新建节点,并将数据存储附加到新节点。If a node-level interruption occurs, the database server automatically creates a new node and attaches data storage to the new node. 这会删除任何活动连接,并且不会提交任何即时事务。Any active connections are dropped and any inflight transactions are not committed.

应用程序重试逻辑至关重要Application retry logic is essential

请务必生成 MariaDB 数据库应用程序,用于检测和重试已删除的连接和无法执行的事务。It is important that MariaDB database applications are built to detect and retry dropped connections and failed transactions. 当应用程序重试时,应用程序的连接会在透明状态下重定向到新创建的实例,以取代失败实例。When the application retries, the application's connection is transparently redirected to the newly created instance, which takes over for the failed instance.

在 Azure 内部,网关用于将连接重定向到新建实例。Internally in Azure, a gateway is used to redirect the connections to the new instance. 发生中断后,整个故障转移过程一般需要几十秒才能完成。Upon an interruption, the entire fail-over process typically takes tens of seconds. 因为重定向由网关内部处理,所以对于客户端应用程序,外部连接字符串也是这样。Since the redirect is handled internally by the gateway, the external connection string remains the same for the client applications.

横向扩展或缩减Scaling up or down

与 HA 模型类似,当 Azure Database for MariaDB 缩放时,将会新建指定大小的服务器实例。Similar to the HA model, when an Azure Database for MariaDB is scaled up or down, a new server instance with the specified size is created. 现有数据存储会从原始实例中拆离,并附加到新实例中。The existing data storage is detached from the original instance, and attached to the new instance.

执行缩放操作期间,数据库连接会中断。During the scale operation, an interruption to the database connections occurs. 客户端应用程序的连接中断,未提交的未结事务也会遭取消。The client applications are disconnected, and open uncommitted transactions are canceled. 在客户端应用程序重试连接或建立新连接后,网关便会将连接定向到新设置大小的实例。Once the client application retries the connection, or makes a new connection, the gateway directs the connection to the newly sized instance.

后续步骤Next steps