SQL server数据库镜像同步技术

SQL sever数据库镜像同步技术

参考网址:

https://learn.microsoft.com/en-us/sql/database-engine/database-mirroring/database-mirroring-sql-server?view=sql-server-ver17

1.概述

Operating Modes

A database mirroring session runs with either synchronous or asynchronous operation. Under asynchronous operation, the transactions commit without waiting for the mirror server to write the log to disk, which maximizes performance. Under synchronous operation, a transaction is committed on both partners, but at the cost of increased transaction latency.
There are two mirroring operating modes. One of them, high-safety mode supports synchronous operation. Under high-safety mode, when a session starts, the mirror server synchronizes the mirror database together with the principal database as quickly as possible. As soon as the databases are synchronized, a transaction is committed on both partners, at the cost of increased transaction latency.
The second operating mode, high-performance mode, runs asynchronously. The mirror server tries to keep up with the log records sent by the principal server. The mirror database might lag somewhat behind the principal database. However, typically, the gap between the databases is small. However, the gap can become significant if the principal server is under a heavy work load or the system of the mirror server is overloaded.
In high-performance mode, as soon as the principal server sends a log record to the mirror server, the principal server sends a confirmation to the client. It doesn't wait for an acknowledgment from the mirror server. This means that transactions commit without waiting for the mirror server to write the log to disk. Such asynchronous operation enables the principal server to run with minimum transaction latency, at the potential risk of some data loss.
All database mirroring sessions support only one principal server and one mirror server. This configuration is shown in the following illustration.

High-safety mode with automatic failover requires a third server instance, known as a witness. Unlike the two partners, the witness doesn't serve the database. The witness supports automatic failover by verifying whether the principal server is up and functioning. The mirror server initiates automatic failover only if the mirror and the witness remain connected to each other after both have been disconnected from the principal server.
The following illustration shows a configuration that includes a witness.

相关推荐
mpHH1 小时前
postgresql-分区表
数据库·postgresql
AC赳赳老秦2 小时前
OpenClaw与WPS宏联动:批量执行WPS复杂操作,解决办公表格批量处理难题
java·前端·数据库·自动化·需求分析·deepseek·openclaw
杜子不疼.2 小时前
用 JiuwenSwarm 搭建 SRE 智能值班体系:告警分级、根因分析与应急手册生成
数据库
接着奏乐接着舞2 小时前
java 数据结构
数据库·redis·缓存
时空自由民.2 小时前
PID介绍
数据库·mongodb
m0_609160492 小时前
如何用 some 检测数组中是否存在至少一个满足条件的项
jvm·数据库·python
|_⊙2 小时前
Linux 深入理解文件(Ext2文件系统:上)
linux·运维·数据库
情绪总是阴雨天~2 小时前
大模型 Function Call(函数调用)详解:原理、实践与数据库智能查询 Agent
前端·数据库·人工智能