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.

相关推荐
Omics Pro2 分钟前
研究证实AI虚拟细胞可用于药物靶点发现
数据库·人工智能·算法·机器学习·自然语言处理
好奇的菜鸟6 分钟前
GORM 入门(二):从 database/sql 平滑过渡到 GORM
数据库·sql
长春的KAKA19 分钟前
GitLab 项目页面报 500 错误的完整修复记录:PostgreSQL 数据库损坏、统计表缺失及数据库迁移
数据库·postgresql·gitlab
这个DBA有点耶33 分钟前
关系数据库管理系统选型指南:四步决策框架与主流产品技术路线对比
数据库·sql·程序人生·mysql·database·dba
jason.zeng@150220740 分钟前
(七)「固化 Rest 接口 + Text-to-SQL 灵活查询」双模式 Agent 架构教程
数据库·python·sql·ai·架构·langchain·ai编程
我不会起名字3221 小时前
MVCC 快照读为什么读不到刚提交的数据:ReadView 的 4 条可见性规则
数据库·mysql·innodb·mvcc·事务隔离
2501_933670792 小时前
2027届数据类专业投用户增长岗:A/B实验、指标和SQL准备思路
数据库·sql
用户337922545682 小时前
Sirchmunk 深度解析(一):一个无需向量数据库的自进化搜索引擎架构设计
数据库
染指11102 小时前
139.Agent-多Agent框架-Skills渐进式加载文档
数据库·人工智能·langchain·agents
骑着蜗牛撵大象3272 小时前
SpringBoot+Vue3 企业智能体侧挂架构:独立服务、独立数据库与主线零侵入落地
数据库·spring boot·架构·vue·springboot·事件驱动·服务拆分