Download presentation
Presentation is loading. Please wait.
Published byLee Knight Modified over 9 years ago
1
Module 11: Introducing Replication
2
Overview Introduction to Distributed Data Introduction to SQL Server Replication SQL Server Replication Agents SQL Server Replication Types Physical Replication Models
3
Introduction to Distributed Data The Need for Distributed Data Considerations for Distributing Data Methods to Distribute Data
4
The Need for Distributed Data Brings Data Closer to the User Allows Site Independence Separates Online transaction processing Read-intensive applications Can Reduce Conflicts
5
Considerations for Distributing Data Factors Timing/Latency Site Autonomy Transactional ConsistencyReplicationReplication UPDATE Distributed Transactions UPDATE
6
Methods to Distribute Data Snapshot Replication Transactional Replication Snapshot Replication with Immediate or Queued Updating Subscriptions Transactional Replication with Immediate or Queued Updating Subscriptions Distributed Transactions Lower Autonomy Lower Latency Lower Autonomy Lower Latency Higher Autonomy Higher Latency Higher Autonomy Higher Latency Merge Replication
7
Introduction to SQL Server Replication The Publisher-Subscriber Metaphor Publications and Articles Filtering Data Subscriptions
8
The Publisher-Subscriber MetaphorPublisherPublisher Maintains source databases Makes data available for replication DistributorDistributor Receives data changes Stores metadata, history, and receives and stores changes May forward changes to subscribers Holds copy of dataSubscriberSubscriber
9
Publications and Articles Publication The basis of a subscription A collection of one or more articles Can have one or more publications per database Article Data from a whole or filtered partition of a table or a database object Part of a publication
10
Filtering Data Subscriber Vertical Filtering Horizontal Filtering 2 3 4 5 6 7 1 ABCDEF 2 3 4 5 6 7 1 ABCDEF 2 3 4 5 6 7 1 ABE 3 6 2 ABCDEF Table A Table B Publisher
11
Subscriptions Subscriber 3 Push Subscription Publication B Subscriber 2 Push Subscription Subscriber 1 Push Subscription Publication A Pull Subscription
12
SQL Server Replication Agents Snapshot Agent Prepares initial snapshots and stores them on the distributor Distribution Agent Moves snapshot and transactional data to Subscribers Log Reader Agent Copies data from transaction log to the distribution database Merge Agent Merges changes from multiple sites Queue Reader Agent Applies changes from a queue and applies them to multiple subscribers
13
SQL Server Replication Types Overview of the Replication Types Considerations for Using Merge Replication
14
Overview of the Replication Types Snapshot Replication Periodic bulk transfer of new snapshots of data Transactional Replication Replication of incremental changes Merge Replication Autonomous changes to replicated data are later merged
15
Considerations for Using Merge Replication Changes to the Schema Identifies a unique column Adds several system tables Creates triggers at Publisher and Subscriber Conflict Resolution Tracks updates Compares values and resolves conflicts Replicates only synchronized data
16
Physical Replication Models Overview of the Physical Replication Models Combining Physical Replication Models and Types Central Publisher/Remote Distributor Example Central Subscriber/Multiple Publishers Example Multiple Publishers/Multiple Subscribers Example
17
Overview of the Physical Replication Models Central Subscriber/Multiple Publishers Publisher/ Distributor Subscriber Publisher/ Distributor Multiple Publishers/Multiple Subscribers Publisher/ Distributor/ Subscriber Publisher/ Distributor/ Subscriber Publisher/ Distributor/ Subscriber Subscribers Publisher/ Distributor Central Publisher/Distributor
18
Combining Physical Replication Models and Types The Model Is the Physical Implementation The Type Provides the Functionality Any of the Models Can Use Any of the Types
19
Central Publisher/Remote Distributor Example New York Publisher London Subscribers Rome Paris Dublin Remote Distributor
20
Central Subscriber/Multiple Publishers Example Region1 Orders Primary Key Reg_code IdId IdId Order_no 1 1000 3100 1000 3100 ~~~~ ~~~~ Qty 15 22 15 22 Region2 Orders Primary Key Reg_code IdId IdId Order_no 2 1000 2380 1000 2380 ~~~~ ~~~~ Qty 32 8 32 8 Region4 Orders Primary Key Reg_code IdId IdId Order_no 4 1000 2000 1000 2000 ~~~~ ~~~~ Qty 43 30 43 30 Region3 Orders Primary Key Reg_code IdId IdId Order_no 3 1000 1070 1000 1070 ~~~~ ~~~~ Qty 7 19 7 19 Publisher Subscriber Master Orders Primary Key Reg_code IdId IdId Order_no 1 2 3 4 1 2 3 4 1000 3100 1000 2380 1000 1070 1000 2000 1000 3100 1000 2380 1000 1070 1000 2000 ~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~ Qty 1 2 3 4 1 2 3 4 1111 1000 3100 ~~~~ 15 22 2222 1000 2380 ~~~~ 32 8 3333 1000 1070 ~~~~ 7 19 4444 1000 2000 ~~~~ 43 30
21
Multiple Publishers/Multiple Subscribers Example Orders (Shop A) Primary Key Area IdId IdId Order_no 1 2 3 1 2 3 1000 3100 1000 2380 1000 1070 1000 3100 1000 2380 1000 1070 ~~~~~~~~~~~~ ~~~~~~~~~~~~ Qty 15 22 32 8 7 19 15 22 32 8 7 19 1111 1000 3100 ~~~~ 15 22 Orders (Shop B) Primary Key Area IdId IdId Order_no 112233112233 112233112233 1000 3100 1000 2380 1000 1070 1000 3100 1000 2380 1000 1070 ~~~~~~~~~~~~ ~~~~~~~~~~~~ Qty 15 22 32 8 7 19 15 22 32 8 7 19 2222 1000 2380 ~~~~ 32 8 Orders (Shop C) Primary Key Area IdId IdId Order_no 112233112233 112233112233 1000 3100 1000 2380 1000 1070 1000 3100 1000 2380 1000 1070 ~~~~~~~~~~~~ ~~~~~~~~~~~~ Qty 15 22 32 8 7 19 15 22 32 8 7 19 3333 3333 1000 1070 1000 1070 ~~~~ ~~~~ 7 19 7 19 Publisher/Subscriber
22
Recommended Practices Determine the Acceptable Degree of Data Latency Select an Appropriate Replication Type Select the Physical Replication Model Determine Whether to Allow Updates to Replicated Data
23
Lab A: Implementing Replication
24
Review Introduction to Distributed Data Introduction to SQL Server Replication SQL Server Replication Agents SQL Server Replication Types Physical Replication Models
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.