Module 11: Introducing Replication. Overview Introduction to Distributed Data Introduction to SQL...
-
Upload
lee-knight -
Category
Documents
-
view
235 -
download
0
Transcript of Module 11: Introducing Replication. Overview Introduction to Distributed Data Introduction to SQL...
![Page 1: Module 11: Introducing Replication. Overview Introduction to Distributed Data Introduction to SQL Server Replication SQL Server Replication Agents SQL.](https://reader035.fdocuments.us/reader035/viewer/2022081506/56649eef5503460f94bff800/html5/thumbnails/1.jpg)
Module 11: Introducing Replication
![Page 2: Module 11: Introducing Replication. Overview Introduction to Distributed Data Introduction to SQL Server Replication SQL Server Replication Agents SQL.](https://reader035.fdocuments.us/reader035/viewer/2022081506/56649eef5503460f94bff800/html5/thumbnails/2.jpg)
Overview
Introduction to Distributed Data
Introduction to SQL Server Replication
SQL Server Replication Agents
SQL Server Replication Types
Physical Replication Models
![Page 3: Module 11: Introducing Replication. Overview Introduction to Distributed Data Introduction to SQL Server Replication SQL Server Replication Agents SQL.](https://reader035.fdocuments.us/reader035/viewer/2022081506/56649eef5503460f94bff800/html5/thumbnails/3.jpg)
Introduction to Distributed Data
The Need for Distributed Data
Considerations for Distributing Data
Methods to Distribute Data
![Page 4: Module 11: Introducing Replication. Overview Introduction to Distributed Data Introduction to SQL Server Replication SQL Server Replication Agents SQL.](https://reader035.fdocuments.us/reader035/viewer/2022081506/56649eef5503460f94bff800/html5/thumbnails/4.jpg)
The Need for Distributed Data
Brings Data Closer to the User
Allows Site Independence
Separates
Online transaction processing
Read-intensive applications
Can Reduce Conflicts
![Page 5: Module 11: Introducing Replication. Overview Introduction to Distributed Data Introduction to SQL Server Replication SQL Server Replication Agents SQL.](https://reader035.fdocuments.us/reader035/viewer/2022081506/56649eef5503460f94bff800/html5/thumbnails/5.jpg)
Considerations for Distributing Data
Factors
Timing/Latency
Site Autonomy
Transactional Consistency
ReplicationReplicationReplicationReplication
UPDATE
Distributed TransactionsDistributed TransactionsDistributed TransactionsDistributed Transactions
UPDATE UPDATE
![Page 6: Module 11: Introducing Replication. Overview Introduction to Distributed Data Introduction to SQL Server Replication SQL Server Replication Agents SQL.](https://reader035.fdocuments.us/reader035/viewer/2022081506/56649eef5503460f94bff800/html5/thumbnails/6.jpg)
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 AutonomyLower Latency
Lower AutonomyLower Latency
Higher AutonomyHigher Latency
Higher AutonomyHigher Latency
Merge Replication
![Page 7: Module 11: Introducing Replication. Overview Introduction to Distributed Data Introduction to SQL Server Replication SQL Server Replication Agents SQL.](https://reader035.fdocuments.us/reader035/viewer/2022081506/56649eef5503460f94bff800/html5/thumbnails/7.jpg)
Introduction to SQL Server Replication
The Publisher-Subscriber Metaphor
Publications and Articles
Filtering Data
Subscriptions
![Page 8: Module 11: Introducing Replication. Overview Introduction to Distributed Data Introduction to SQL Server Replication SQL Server Replication Agents SQL.](https://reader035.fdocuments.us/reader035/viewer/2022081506/56649eef5503460f94bff800/html5/thumbnails/8.jpg)
The Publisher-Subscriber Metaphor
PublisherPublisherPublisherPublisher
Maintains source databases
Makes data available for replication
DistributorDistributorDistributorDistributor
Receives data changes
Stores metadata, history, and receives and stores changes
May forward changes to subscribers
Holds copy of data
SubscriberSubscriberSubscriberSubscriber
![Page 9: Module 11: Introducing Replication. Overview Introduction to Distributed Data Introduction to SQL Server Replication SQL Server Replication Agents SQL.](https://reader035.fdocuments.us/reader035/viewer/2022081506/56649eef5503460f94bff800/html5/thumbnails/9.jpg)
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
![Page 10: Module 11: Introducing Replication. Overview Introduction to Distributed Data Introduction to SQL Server Replication SQL Server Replication Agents SQL.](https://reader035.fdocuments.us/reader035/viewer/2022081506/56649eef5503460f94bff800/html5/thumbnails/10.jpg)
Filtering Data
Subscriber
Vertical Filtering
Horizontal Filtering
234567
1A B C D E F
234567
1A B C D E F
234567
1A B E
36
2A B C D E F
Table A
Table B Publisher
![Page 11: Module 11: Introducing Replication. Overview Introduction to Distributed Data Introduction to SQL Server Replication SQL Server Replication Agents SQL.](https://reader035.fdocuments.us/reader035/viewer/2022081506/56649eef5503460f94bff800/html5/thumbnails/11.jpg)
Subscriptions
Subscriber 3Subscriber 3Subscriber 3Subscriber 3
Push Subscription
Push Subscription
Push Subscription
Push SubscriptionPublication BPublication BPublication BPublication B
Subscriber 2Subscriber 2Subscriber 2Subscriber 2
Push Subscription
Push Subscription
Push Subscription
Push SubscriptionSubscriber 1Subscriber 1Subscriber 1Subscriber 1
Push SubscriptionPush SubscriptionPush SubscriptionPush Subscription
Publication APublication APublication APublication A
Pull SubscriptionPull SubscriptionPull SubscriptionPull Subscription
![Page 12: Module 11: Introducing Replication. Overview Introduction to Distributed Data Introduction to SQL Server Replication SQL Server Replication Agents SQL.](https://reader035.fdocuments.us/reader035/viewer/2022081506/56649eef5503460f94bff800/html5/thumbnails/12.jpg)
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
![Page 13: Module 11: Introducing Replication. Overview Introduction to Distributed Data Introduction to SQL Server Replication SQL Server Replication Agents SQL.](https://reader035.fdocuments.us/reader035/viewer/2022081506/56649eef5503460f94bff800/html5/thumbnails/13.jpg)
SQL Server Replication Types
Overview of the Replication Types
Considerations for Using Merge Replication
![Page 14: Module 11: Introducing Replication. Overview Introduction to Distributed Data Introduction to SQL Server Replication SQL Server Replication Agents SQL.](https://reader035.fdocuments.us/reader035/viewer/2022081506/56649eef5503460f94bff800/html5/thumbnails/14.jpg)
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
![Page 15: Module 11: Introducing Replication. Overview Introduction to Distributed Data Introduction to SQL Server Replication SQL Server Replication Agents SQL.](https://reader035.fdocuments.us/reader035/viewer/2022081506/56649eef5503460f94bff800/html5/thumbnails/15.jpg)
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
![Page 16: Module 11: Introducing Replication. Overview Introduction to Distributed Data Introduction to SQL Server Replication SQL Server Replication Agents SQL.](https://reader035.fdocuments.us/reader035/viewer/2022081506/56649eef5503460f94bff800/html5/thumbnails/16.jpg)
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
![Page 17: Module 11: Introducing Replication. Overview Introduction to Distributed Data Introduction to SQL Server Replication SQL Server Replication Agents SQL.](https://reader035.fdocuments.us/reader035/viewer/2022081506/56649eef5503460f94bff800/html5/thumbnails/17.jpg)
Overview of the Physical Replication Models
Central Subscriber/Multiple PublishersCentral Subscriber/Multiple PublishersCentral Subscriber/Multiple PublishersCentral Subscriber/Multiple Publishers
Publisher/Distributor
SubscriberPublisher/Distributor
Publisher/Distributor
Publisher/Distributor
Multiple Publishers/Multiple SubscribersMultiple Publishers/Multiple SubscribersMultiple Publishers/Multiple SubscribersMultiple Publishers/Multiple Subscribers
Publisher/Distributor/Subscriber
Publisher/Distributor/Subscriber
Publisher/Distributor/Subscriber
Subscribers
Publisher/Distributor
Central Publisher/DistributorCentral Publisher/DistributorCentral Publisher/DistributorCentral Publisher/Distributor
![Page 18: Module 11: Introducing Replication. Overview Introduction to Distributed Data Introduction to SQL Server Replication SQL Server Replication Agents SQL.](https://reader035.fdocuments.us/reader035/viewer/2022081506/56649eef5503460f94bff800/html5/thumbnails/18.jpg)
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
![Page 19: Module 11: Introducing Replication. Overview Introduction to Distributed Data Introduction to SQL Server Replication SQL Server Replication Agents SQL.](https://reader035.fdocuments.us/reader035/viewer/2022081506/56649eef5503460f94bff800/html5/thumbnails/19.jpg)
Central Publisher/Remote Distributor Example
New York
Publisher
London
Subscribers
Rome
Paris
Dublin
RemoteDistributor
![Page 20: Module 11: Introducing Replication. Overview Introduction to Distributed Data Introduction to SQL Server Replication SQL Server Replication Agents SQL.](https://reader035.fdocuments.us/reader035/viewer/2022081506/56649eef5503460f94bff800/html5/thumbnails/20.jpg)
Central Subscriber/Multiple Publishers Example
RRegion1 Ordersegion1 OrdersRRegion1 Ordersegion1 OrdersPrimary KeyPrimary Key
Reg_codeReg_code IdId Order_noOrder_no
1 1
1 1
10003100
10003100
~~
~~
QtyQty
1522
1522
RRegion2egion2 Orders OrdersRRegion2egion2 Orders OrdersPrimary KeyPrimary Key
Reg_codeReg_code IdId Order_noOrder_no
2 2
2 2
10002380
10002380
~~
~~
QtyQty
328
328
RRegion4 Ordersegion4 OrdersRRegion4 Ordersegion4 OrdersPrimary KeyPrimary Key
Reg_codeReg_code IdId Order_noOrder_no
4 4
4 4
10002000
10002000
~~
~~
QtyQty
4330
4330
RRegion3 egion3 OrdersOrdersRRegion3 egion3 OrdersOrdersPrimary KeyPrimary Key
Reg_codeReg_code IdId Order_noOrder_no
3 3
3 3
10001070
10001070
~~
~~
QtyQty
719
719
Publisher
Publisher
Publisher
Publisher Subscriber
MasterMaster O OrdersrdersMasterMaster O OrdersrdersPrimary KeyPrimary Key
Reg_codeReg_code IdId Order_noOrder_no
1 1 2 2 3 3 4 4
1 1 2 2 3 3 4 4
10003100100023801000107010002000
10003100100023801000107010002000
~~~~~~~~
~~~~~~~~
QtyQty
1 1 2 2 3 3 4 4
1 1 2 2 3 3 4 4
11
10003100
~~
1522
22
10002380
~~
328
33
10001070
~~
719
44
10002000
~~
4330
![Page 21: Module 11: Introducing Replication. Overview Introduction to Distributed Data Introduction to SQL Server Replication SQL Server Replication Agents SQL.](https://reader035.fdocuments.us/reader035/viewer/2022081506/56649eef5503460f94bff800/html5/thumbnails/21.jpg)
Multiple Publishers/Multiple Subscribers Example
OOrders rders (Shop A)(Shop A)OOrders rders (Shop A)(Shop A)Primary KeyPrimary Key
AreaArea IdId Order_noOrder_no
1 12233
1 12233
100031001000238010001070
100031001000238010001070
~~~~~~
~~~~~~
QtyQty
15223287
19
15223287
19
11
10003100
~~
1522
OOrders rders (Shop B)(Shop B)OOrders rders (Shop B)(Shop B)Primary KeyPrimary Key
AreaArea IdId Order_noOrder_no
112233
112233
100031001000238010001070
100031001000238010001070
~~~~~~
~~~~~~
QtyQty
15223287
19
15223287
19
22
10002380
~~
328
OOrders rders (Shop C)(Shop C)OOrders rders (Shop C)(Shop C)Primary KeyPrimary Key
AreaArea IdId Order_noOrder_no
112233
112233
100031001000238010001070
100031001000238010001070
~~~~~~
~~~~~~
QtyQty
15223287
19
15223287
19
33
33
10001070
10001070
~~
~~
719
719
Publisher/Subscriber
Publisher/SubscriberPublisher/Subscriber
![Page 22: Module 11: Introducing Replication. Overview Introduction to Distributed Data Introduction to SQL Server Replication SQL Server Replication Agents SQL.](https://reader035.fdocuments.us/reader035/viewer/2022081506/56649eef5503460f94bff800/html5/thumbnails/22.jpg)
Recommended Practices
Determine the Acceptable Degree of Data LatencyDetermine the Acceptable Degree of Data Latency
Select an Appropriate Replication TypeSelect an Appropriate Replication Type
Select the Physical Replication ModelSelect the Physical Replication Model
Determine Whether to Allow Updates to Replicated DataDetermine Whether to Allow Updates to Replicated Data
![Page 23: Module 11: Introducing Replication. Overview Introduction to Distributed Data Introduction to SQL Server Replication SQL Server Replication Agents SQL.](https://reader035.fdocuments.us/reader035/viewer/2022081506/56649eef5503460f94bff800/html5/thumbnails/23.jpg)
Lab A: Implementing Replication
![Page 24: Module 11: Introducing Replication. Overview Introduction to Distributed Data Introduction to SQL Server Replication SQL Server Replication Agents SQL.](https://reader035.fdocuments.us/reader035/viewer/2022081506/56649eef5503460f94bff800/html5/thumbnails/24.jpg)
Review
Introduction to Distributed Data
Introduction to SQL Server Replication
SQL Server Replication Agents
SQL Server Replication Types
Physical Replication Models