Boost PC performance: How more available memory can improve productivity
Sqlpass The Magic Of Replication
1. The Magic of Replication What’s new in SQL Server 2008 Replication?
2. Who Am I? Meir Dudai SQL Server consultant – Valinor (SQL Server Consulting Services) Working with SQL Server for 10 years Specialize in Replication, my favorite feature in SQL Server Operating SQL Server Israeli website: http://www.SQLServer.co.il/ meir@valinor.co.il
5. SQL Server’s greatest challenge We want availability and scalability! The database is a single point of failure The database sometimes is the performance bottleneck Scale Out Scale Up
11. What is Replication? “Make copies of digital material for backup, performance, reliability, or preservation” (Digital Libraries, by William Arms) “The use of redundant resources to improve reliability, fault-tolerance, or performance “ (Wikipedia)
14. Introduction to Peer-to-Peer Replication Databases replicate reciprocally and are writable Redundancy provides fault tolerance and lowers maintenance downtime Online upgrades possible
15. Peer-to-Peer Topology Logreader Agent Logreader Agent Logreader Agent Dist DB Dist DB Dist DB Distribution Agent Distribution Agent Distribution Agent Los Angeles London Transactional Replication Taipei
20. Challenges Design your schema and topology properly to prevent conflicts P2P is an asynchronous solution and does not guarantee zero data loss or zero latency Not completely transparent Although transparent enough!
21. Agenda SQL Server’s greatest challenge Replication overview Peer-to-Peer Replication Replication enhancements in SQL Server 2008
22. Changing replication topology online In SQL Server 2005, replication had to be stopped (quiesced) in order to perform some actions: Add nodes Schema changes In SQL Server 2008, these actions can be done online And you also get a cool wizard in SSMS…
24. Conflict Detection and Resolution SQL Server 2008 introduces conflict detection capability in peer-to-peer replication All types of conflicts are detected and reported though agent error reporting or conflict tables Two options on detecting conflict Fail replication stream Continue stream after logging conflict Update tbl_user set Name =‘camern’ Update tbl_user set Name =‘cameron’
25. Conflict Detection and Resolution Conflicts are resolved based on originator_id value – higher wins Manual resolution of conflicts is required in most cases Best approach: Prevent conflicts through write partitioning even with conflict detection capabilities available Update tbl_user set Name =‘camern’ Update tbl_user set Name =‘cameron’
26.
27. Enabling Conflict Detection Enable conflict detection in publication properties Set a value for the originator ID Specify action in case of conflict: Stop and alert (default) Continue (may cause data inconsistency)
28. Viewing conflicts When a conflict occurs, replication will stop by default You can view the conflict using Conflict Viewer in SSMS and address it manually
30. Replicating partition switch In SQL Server 2005, switch partition action was unsupported in replicated environment This was a major consideration for organizations when deciding whether to use replication or not In SQL Server 2008, you can switch partition on a replicated table, and replicate this action Requires some settings in publication properties
31. Replicating partition switch Publication properties: @allow_partition_switch: allows SWITCH PARTITION to be executed against the publication database @replicate_partition_switch: determines whether the SWITCH PARTITION DDL statement should be replicated to Subscribers Preparations: Make sure that all tables that are involved in partition switching exist at the Publisher and Subscriber Make sure that the table and partition definitions are the same Switch partition using ALTER TABLE command
32. Performance improvements Under Windows Server 2008, replication works faster than ever: Snapshot delivery of more than 500MB/minute One of the interesting benchmarks for a pull subscriber, time to deliver 100,000 varbinary (max) records: Win2003/SQL2005 – 223 minutes Win2008/SQL2008 – less than 2 minutes!
33. Conclusion Peer-to-Peer Replication can provide one of the best methods for systems scale out Dramatically increase performance Eliminate downtime SQL Server 2008 provides major improvements for Peer-to-Peer Replication, and makes it accessible and more robust
34. Related sessions Building a High Availability Strategy for your Enterprise Gopal Ashok Wednesday, 10:15AM Transactional Replication: Beyond The Basics Kendal Van Dyke Thursday, 4:00PM
36. Complete the Evaluation Form & Win! You could win a Dell Mini Netbook– every day – just for handing in your completed form! Each session form is another chance to win! Pick up your Evaluation Form: Within each presentation room At the PASS Booth near registration area Drop off your completed Form: Near the exit of each presentation room At the PASS Booth near registration area Sponsored by Dell
37. Thank you for attending this session and the 2009 PASS Summit in Seattle