SQL Server Replication for High Availability SQL Support

SQL Server Replication for High Availability SQL Support Seung Wan Choi


미리보기 : Microsoft SQL Server Replication n 3분 30초 의 이 애내메이션은 SQL Server Replication 의 개념을 간단히 잘 설명하고 있습니다. l 스냅샷 복제(Snapshot Replication) l 트랜잭션 복제(Transactional Replication) l 병합 복제(Merge Replication)





복제 동작 (1 of 3) 구독자(Subscriber) 게시자(Publisher) Receives data changes Maintains source databases Makes data available for replication 배포자(Distributor) Stores metadata, history, and receives and stores changes May forward changes to Subscribers Holds copy of data


복제 동작 (3 of 3) n Subscriptions Publication A Push subscription Push s ubscrip tion Publication B tion p i r c s b u Pull s Push subsc ription

복제 에이전트 Snapshot Transactional Snapshot Agent Distribution Agent Log Reader Agent Merge Snapshot Agent Merge Agent Queue Reader Agent















중앙 게시자 와 배포자 Berlin headquarters London 중앙 중앙게시자와 Remote 배포 배포자 Paris Rome Athens 1 2 3 Moscow

Republisher 사용 Seoul republishes to Beijing, Hong Kong, and Sydney Seoul Seattle k Slow lin San Francisco Beijing Dallas Hong Kong Sydney 1 2 3 San Francisco publishes to Seattle, Dallas, and Seoul

복제 대상 객체 n 복제 가능 객체 l Stored Procedures l Views l Tables l Triggers

자율성 과 대기 (Autonomy and Latency) Merge replication Snapshot replication Updatable snapshot replication Transactional replication Updatable transactional replication Distributed transactions Lower autonomy Lower latency Higher autonomy Higher latency

복제 와 기타 데이터 분산 기술의 대비 Method Autonomy Latency Replication Variable, depending on type Distributed Transactions Low Distributed Queries Low Back up and Restore High Data Transformation Services (DTS) Special use only

Standby Solution 과 비교 n n Hot Standby Failover Support l Failover Clustering 필요 l 실패 감지 와 failover 가 자동. Warm Standby Solution l 로그 전달 (Log shipping) – 주서버로부터 보조 서버로 백업을 전달. l 복제 (Replication) – 보조서버로 동시에 데이 터 접근을 가능하게 함.




Lesson : HA를 위한 복제 구성 n HA 를 위한 디스크 구성 l Impact depending on topology choice n 복제 모니터를 사용하여 복제 솔루션 감시 n Schema Design 과 복제 n 복제시 Schema 변경 n HA 와 연관된 Architecture 문제 l Scheduling Change Forwarding and Reducing Latency l Directing to Replicated Data


복제 솔루션을 사용할때 실패 관리 시나리오 게시자 배포자 구독자 A Up Up Down B Up Down Up C Up Down D Down Up Up E Down Up Down F Down Up G Down


복제 와 스키마 디자인 n n 복제되는 테이블 당 최대 열 숫자: l 스냅샷, 트랜잭션 : 255 l 병합: 245 복제되는 테이블의 최대 행 크기: l 스냅샷, 트랜잭션: 8, 000 bytes l 병합: 6, 000 bytes n Primary and Foreign Keys n TEXT and IMAGE fields n Integer columns n Timestamp Columns



복제된 데이터 소스로 Redirect n 역할 변경후, 애플리케이션과 클라이언트는 새로 운 primary 로 접근. n 고려할수 있는 방법: l ODBC DSN l Network Load Balancing l Rename the SQL Server (non-clustered only)

SQL Server 복제 기술의 High-Availability 특 징 High Availability Feature Transactional Replication Standby type Warm Failure detection No, but with NLB … Automatic failover No, but with NLB … Protects against failed server process Yes, but … Protects against failed disk Yes, but … Meta data support Some user schema and data Transactionally consistent Yes Transactionally current No, since last replicated transaction Performance impact Log reader continually running Time to fail over Seconds, more to recover more thoroughly Locations Dispersed Additional complexity More Number of nodes No limit Standby available for reporting, etc. Yes Partitioning of data to standby Yes

데모 (optional) n SQL 복제 구성 n 모의 실험 “Server Down” l Switch to the secondary l Redirect clients to the replicated data using ODBC
- Slides: 44