SlideShare a Scribd company logo
1 of 15
Download to read offline
Conquer Reporting By Scaling Out SQL Server




                        January 16, 2013
My Contact Information
Anthony Sammartino MCITP(BI), PMP®
Vice President
TekPartners Business Intelligence Solutions
(954) 282-1798
asammartino@tekpartners.com

Twitter: @SQLAnt

Linkedin: http://www.linkedin.com/in/apsammartino

Blog: www.sqlant.me

Web: www.tekpartnersbi.com
About Me
• Started working with SQL Server 7.0 in 1999


• 14 Data Warehouse / BI Projects in 13 Years


• 11 Years SQL Server 2000, 2005, 2008(R2), 2012


• Live in South Florida with my wife and two daughters


• Fan of Miami and Philadelphia Sports teams, all things technology


• Solutions Architect, Project Manager, Technical Lead
  MCP(SQL Server), MCTS(BI), MCITP(BI), PMP®
Session Overview
1. Case for Scaling Out SQL Server for Reporting
2. Choosing a Method to Scale Out SQL Server
3. Architecture with Reporting Scaled Out
4. Replication Server Roles
5. Replication Agents
6. Distribution Database
7. Publications, Articles, Subscriptions
8. Partitioning
9. References for Replication
10. Questions
The "Situation"
Problem Statement:
A company named (House Widgets Inc.) has a main application that sells
widgets online. Every time the Sales staff runs reports to see how many
widgets were sold the application slows, and even times out.
Sales staff complains their reports are slow. Users complain application is slow.

Background:
• DBA team has tuned the reports (T-SQL) through execution plans.
• They also verified its using the correct indexes (Seeks).
• They even resorted to dirty reads using isolation level and nolocks in the code.
• Deemed the data is just to large and too busy. Thousands of users are trying to access
   it, change it at the same time.
• Solid State Disks were even thrown at it. Helped for a short time.

Resolution:
• Time to think about separating the databases for the application and reporting.
• Many ways to scale out SQL Server for reporting.
• Many variables to think about.
Choosing a Method to Scale Out
Requirements
• Requirement is to have real time reporting.
• Requirement is to only report on half of the db tables.

Transactional Replication…Why?
• Transactional Replication happens in near real time.
• Once setup, transactions flow.

Other types of Replication
• Snapshot: Point in time. For example once a day at 9am.
   Not Near real time.
• Merge: Near real time but ideal for situations where two dbs
   need to be kept in sync with writes in two locations.
   Example: Bank with two branches in NY, FL.

Database Mirroring
• Mirroring is very easy to setup and maintain.
• It’s a whole database or nothing solution.
• Point in time using database snapshots.

Always On Availability Groups *NEW SQL Server 2012
• Near real time transactions.
• It’s a whole database or nothing solution.
• Enterprise Edition needed $$$ on both Source and Replica.

Service Broker
• Near real time transactions.
• Harder to setup and maintain, more suited for transforming data.
Architecture with Reporting Scaled Out to a Replica
                         Application (HouseWidgets.com)




       SQL Server (SQLVM03)                          SQL Server (SQLVM03SUBSCRIBER)
             Publisher                                    Distributor & Subscriber



           Application                                                   Application DB-
              DB                                          Distribution      Replica
                                     Transactional
                                      Replication                                  Read Only
Replication Server Roles
Publisher:
The publisher is the source SQL Server that contains database objects that you
wish to replicate. In this case SQLVM03.


Distributor:
The distributor is the server that you wish to setup to “distribute” transactions
from the publisher to the subscriber server.


Subscriber:
The Subscriber is the server that hosts the replica database and where the
reporting will be directed from the application. In this case SQLVM03Subscriber
Secret Agents…Man
• Replication creates a number of Agents.

• These Agents run as jobs scheduled under SQL
  Server Agent.

• SQL Server Agent must be turned on.

• Recommend restarting options be checked, and
  configure SQL Server Agent with a service account
  with access to both machines.

• Replication agents can be administered from SQL
  Server Replication Monitor and SQL Server
  Management Studio.
More Secret Agents
Snapshot Agent
• Used with all types of replication.
• It prepares schema and initial data files of published tables and other objects.
• Records information about synchronization in the distribution database.
• The Snapshot Agent runs at the Distributor.

Log Reader Agent
• Used with transactional replication.
• Moves transactions marked for replication from the Publisher to the
  distribution database. Each database published using transactional replication
  has its own Log Reader Agent.

Distribution Agent
• Used with snapshot replication and transactional replication.
• It applies the initial snapshot to the Subscriber and moves transactions held
  in the distribution database to Subscribers.
• The Distribution Agent runs at either the Distributor for
  push subscriptions or at the Subscriber for pull subscriptions.
More Secret Agents
Merge Agent
• Used with merge replication.
• It applies the initial snapshot to the Subscriber and moves and reconciles
  incremental data changes that occur.
• Each merge subscription has its own Merge Agent that connects to both the
  Publisher and the Subscriber and updates both.
• The Merge Agent runs at either the Distributor for push subscriptions or the
  Subscriber for pull subscriptions.

Replication Maintenance Jobs
Replication has a number of maintenance jobs that perform scheduled and
on-demand maintenance.
Distribution Database
Distribution DB
The distribution database holds all of the transactions from the publisher
database and applies them to the subscriber.

Performance Tip
As a general rule of thumb for smaller publisher database
implementations small in size, small number of concurrent users, small number
of transactions, place the distributor and subscriber on one server separate
from the publisher.

For larger database implementations large in size, large number of concurrent
users, large number of transactions, place the distributor on its own server and
the subscriber on its own server, both separate from the publisher.

Always separate the distributor and subscriber from the publisher.
Your goal is to take load off the publisher with this architectural solution.
Publications, Articles, Subscriptions
Publications
A Publication is what is created on the Publisher server and stores articles that
will be replicated.

Tip: One table per publication, especially if they are large. Re-snapshot.


Articles
Tables, Stored Procedures, Views , Indexed Views, User Defined Functions.



Subscriptions
A Subscriber is what is created on the Subscriber server to receive all of the
transactions of the Publication.
Partitioning Large Tables – How to deal?
• Partitioning Schemes can be propogated from the Publisher
  but don’t have to.


• They can also be created a the subscriber entirely different better for
  reporting.


• If you want to archive the Publishing database but keep the subscriber
  around you can get creative with Partition swapping.


• Replication is scalable. I have replicated a 6 billion record table with good
  performance. A lot of partitions 
Replication References
http://www.replicationanswers.com

Paul Ibison’s website full of good replication…well answers.

http://www.sqlsoldier.com

Robert Davis’s website and if you use the search box you can find some good stuff
on replication

Twitter: #sqlhelp

More Related Content

What's hot

Geek Sync | Field Medic’s Guide to Database Mirroring
Geek Sync | Field Medic’s Guide to Database MirroringGeek Sync | Field Medic’s Guide to Database Mirroring
Geek Sync | Field Medic’s Guide to Database MirroringIDERA Software
 
Scalability Considerations
Scalability ConsiderationsScalability Considerations
Scalability ConsiderationsNavid Malek
 
Building diagnostic queries using DMVs and DMFs
Building diagnostic queries using DMVs and DMFs Building diagnostic queries using DMVs and DMFs
Building diagnostic queries using DMVs and DMFs Antonios Chatzipavlis
 
Using Snap Clone with Enterprise Manager 12c
Using Snap Clone with Enterprise Manager 12cUsing Snap Clone with Enterprise Manager 12c
Using Snap Clone with Enterprise Manager 12cPete Sharman
 
Implementing sql server always on
Implementing sql server always onImplementing sql server always on
Implementing sql server always onSarabpreet Anand
 
Sql server 2012 - always on deep dive - bob duffy
Sql server 2012 - always on deep dive - bob duffySql server 2012 - always on deep dive - bob duffy
Sql server 2012 - always on deep dive - bob duffyAnuradha
 
Modernizing your database with SQL Server 2019
Modernizing your database with SQL Server 2019Modernizing your database with SQL Server 2019
Modernizing your database with SQL Server 2019Antonios Chatzipavlis
 
Evaluating Cloud Database Offerings
Evaluating Cloud Database OfferingsEvaluating Cloud Database Offerings
Evaluating Cloud Database OfferingsChristopher Foot
 
NZSPC 2013 - Ultimate SharePoint Infrastructure Best Practices Session
NZSPC 2013 - Ultimate SharePoint Infrastructure Best Practices SessionNZSPC 2013 - Ultimate SharePoint Infrastructure Best Practices Session
NZSPC 2013 - Ultimate SharePoint Infrastructure Best Practices SessionMichael Noel
 
Always on in SQL Server 2012
Always on in SQL Server 2012Always on in SQL Server 2012
Always on in SQL Server 2012Fadi Abdulwahab
 
Databases overview & concepts
Databases overview & conceptsDatabases overview & concepts
Databases overview & conceptsParag Patil
 
SQL Server Performance Tuning Baseline
SQL Server Performance Tuning BaselineSQL Server Performance Tuning Baseline
SQL Server Performance Tuning Baseline► Supreme Mandal ◄
 
SQL Server Cluster Presentation
SQL Server Cluster PresentationSQL Server Cluster Presentation
SQL Server Cluster Presentationwebhostingguy
 
Multi-tenancy in Java
Multi-tenancy in JavaMulti-tenancy in Java
Multi-tenancy in Javaseges
 
Exploring Scalability, Performance And Deployment
Exploring Scalability, Performance And DeploymentExploring Scalability, Performance And Deployment
Exploring Scalability, Performance And Deploymentrsnarayanan
 
Design Considerations For Storing With Windows Azure
Design Considerations For Storing With Windows AzureDesign Considerations For Storing With Windows Azure
Design Considerations For Storing With Windows AzureEric Nelson
 

What's hot (20)

Ibm info sphere datastage tutorial part 1 architecture examples
Ibm info sphere datastage tutorial part 1  architecture examplesIbm info sphere datastage tutorial part 1  architecture examples
Ibm info sphere datastage tutorial part 1 architecture examples
 
Geek Sync | Field Medic’s Guide to Database Mirroring
Geek Sync | Field Medic’s Guide to Database MirroringGeek Sync | Field Medic’s Guide to Database Mirroring
Geek Sync | Field Medic’s Guide to Database Mirroring
 
Del 1
Del 1Del 1
Del 1
 
Scalability Considerations
Scalability ConsiderationsScalability Considerations
Scalability Considerations
 
Building diagnostic queries using DMVs and DMFs
Building diagnostic queries using DMVs and DMFs Building diagnostic queries using DMVs and DMFs
Building diagnostic queries using DMVs and DMFs
 
Using Snap Clone with Enterprise Manager 12c
Using Snap Clone with Enterprise Manager 12cUsing Snap Clone with Enterprise Manager 12c
Using Snap Clone with Enterprise Manager 12c
 
Cloud database
Cloud databaseCloud database
Cloud database
 
Implementing sql server always on
Implementing sql server always onImplementing sql server always on
Implementing sql server always on
 
Sql server 2012 - always on deep dive - bob duffy
Sql server 2012 - always on deep dive - bob duffySql server 2012 - always on deep dive - bob duffy
Sql server 2012 - always on deep dive - bob duffy
 
Scalability Design Principles - Internal Session
Scalability Design Principles - Internal SessionScalability Design Principles - Internal Session
Scalability Design Principles - Internal Session
 
Modernizing your database with SQL Server 2019
Modernizing your database with SQL Server 2019Modernizing your database with SQL Server 2019
Modernizing your database with SQL Server 2019
 
Evaluating Cloud Database Offerings
Evaluating Cloud Database OfferingsEvaluating Cloud Database Offerings
Evaluating Cloud Database Offerings
 
NZSPC 2013 - Ultimate SharePoint Infrastructure Best Practices Session
NZSPC 2013 - Ultimate SharePoint Infrastructure Best Practices SessionNZSPC 2013 - Ultimate SharePoint Infrastructure Best Practices Session
NZSPC 2013 - Ultimate SharePoint Infrastructure Best Practices Session
 
Always on in SQL Server 2012
Always on in SQL Server 2012Always on in SQL Server 2012
Always on in SQL Server 2012
 
Databases overview & concepts
Databases overview & conceptsDatabases overview & concepts
Databases overview & concepts
 
SQL Server Performance Tuning Baseline
SQL Server Performance Tuning BaselineSQL Server Performance Tuning Baseline
SQL Server Performance Tuning Baseline
 
SQL Server Cluster Presentation
SQL Server Cluster PresentationSQL Server Cluster Presentation
SQL Server Cluster Presentation
 
Multi-tenancy in Java
Multi-tenancy in JavaMulti-tenancy in Java
Multi-tenancy in Java
 
Exploring Scalability, Performance And Deployment
Exploring Scalability, Performance And DeploymentExploring Scalability, Performance And Deployment
Exploring Scalability, Performance And Deployment
 
Design Considerations For Storing With Windows Azure
Design Considerations For Storing With Windows AzureDesign Considerations For Storing With Windows Azure
Design Considerations For Storing With Windows Azure
 

Similar to Divide & Conquer Reporting By Scaling Out with Replication

Case Study For Replication For PCMS
Case Study For Replication For PCMSCase Study For Replication For PCMS
Case Study For Replication For PCMSShahzad
 
Sql disaster recovery
Sql disaster recoverySql disaster recovery
Sql disaster recoverySqlperfomance
 
KoprowskiT_SQLSaturday409_MaintenancePlansForBeginners
KoprowskiT_SQLSaturday409_MaintenancePlansForBeginnersKoprowskiT_SQLSaturday409_MaintenancePlansForBeginners
KoprowskiT_SQLSaturday409_MaintenancePlansForBeginnersTobias Koprowski
 
KoprowskiT_SQLSat409_MaintenancePlansForBeginners
KoprowskiT_SQLSat409_MaintenancePlansForBeginnersKoprowskiT_SQLSat409_MaintenancePlansForBeginners
KoprowskiT_SQLSat409_MaintenancePlansForBeginnersTobias Koprowski
 
UNIT3 DBMS.pptx operation nd management of data base
UNIT3 DBMS.pptx operation nd management of data baseUNIT3 DBMS.pptx operation nd management of data base
UNIT3 DBMS.pptx operation nd management of data baseshindhe1098cv
 
Stay productive_while_slicing_up_the_monolith
Stay productive_while_slicing_up_the_monolithStay productive_while_slicing_up_the_monolith
Stay productive_while_slicing_up_the_monolithMarkus Eisele
 
Virtualizing Tier One Applications - Varrow
Virtualizing Tier One Applications - VarrowVirtualizing Tier One Applications - Varrow
Virtualizing Tier One Applications - VarrowAndrew Miller
 
Varrow Q4 Lunch & Learn Presentation - Virtualizing Business Critical Applica...
Varrow Q4 Lunch & Learn Presentation - Virtualizing Business Critical Applica...Varrow Q4 Lunch & Learn Presentation - Virtualizing Business Critical Applica...
Varrow Q4 Lunch & Learn Presentation - Virtualizing Business Critical Applica...Andrew Miller
 
Boosting the Performance of your Rails Apps
Boosting the Performance of your Rails AppsBoosting the Performance of your Rails Apps
Boosting the Performance of your Rails AppsMatt Kuklinski
 
Database Virtualization: The Next Wave of Big Data
Database Virtualization: The Next Wave of Big DataDatabase Virtualization: The Next Wave of Big Data
Database Virtualization: The Next Wave of Big Dataexponential-inc
 
Marketing Automation at Scale: How Marketo Solved Key Data Management Challen...
Marketing Automation at Scale: How Marketo Solved Key Data Management Challen...Marketing Automation at Scale: How Marketo Solved Key Data Management Challen...
Marketing Automation at Scale: How Marketo Solved Key Data Management Challen...Continuent
 
SOA with Zend Framework
SOA with Zend FrameworkSOA with Zend Framework
SOA with Zend FrameworkMike Willbanks
 
Azure SQL Database for the SQL Server DBA - Azure Bootcamp Athens 2018
Azure SQL Database for the SQL Server DBA - Azure Bootcamp Athens 2018 Azure SQL Database for the SQL Server DBA - Azure Bootcamp Athens 2018
Azure SQL Database for the SQL Server DBA - Azure Bootcamp Athens 2018 Antonios Chatzipavlis
 
Migrate a successful transactional database to azure
Migrate a successful transactional database to azureMigrate a successful transactional database to azure
Migrate a successful transactional database to azureIke Ellis
 
Introduction to Microservices
Introduction to MicroservicesIntroduction to Microservices
Introduction to MicroservicesMahmoudZidan41
 
Sql server replication step by step
Sql server replication step by stepSql server replication step by step
Sql server replication step by steplaonap166
 
DBA, LEVEL III TTLM Monitoring and Administering Database.docx
DBA, LEVEL III TTLM Monitoring and Administering Database.docxDBA, LEVEL III TTLM Monitoring and Administering Database.docx
DBA, LEVEL III TTLM Monitoring and Administering Database.docxseifusisay06
 
Building and Deploying Large Scale SSRS using Lessons Learned from Customer D...
Building and Deploying Large Scale SSRS using Lessons Learned from Customer D...Building and Deploying Large Scale SSRS using Lessons Learned from Customer D...
Building and Deploying Large Scale SSRS using Lessons Learned from Customer D...Denny Lee
 

Similar to Divide & Conquer Reporting By Scaling Out with Replication (20)

Case Study For Replication For PCMS
Case Study For Replication For PCMSCase Study For Replication For PCMS
Case Study For Replication For PCMS
 
Sql disaster recovery
Sql disaster recoverySql disaster recovery
Sql disaster recovery
 
KoprowskiT_SQLSaturday409_MaintenancePlansForBeginners
KoprowskiT_SQLSaturday409_MaintenancePlansForBeginnersKoprowskiT_SQLSaturday409_MaintenancePlansForBeginners
KoprowskiT_SQLSaturday409_MaintenancePlansForBeginners
 
KoprowskiT_SQLSat409_MaintenancePlansForBeginners
KoprowskiT_SQLSat409_MaintenancePlansForBeginnersKoprowskiT_SQLSat409_MaintenancePlansForBeginners
KoprowskiT_SQLSat409_MaintenancePlansForBeginners
 
UNIT3 DBMS.pptx operation nd management of data base
UNIT3 DBMS.pptx operation nd management of data baseUNIT3 DBMS.pptx operation nd management of data base
UNIT3 DBMS.pptx operation nd management of data base
 
Stay productive_while_slicing_up_the_monolith
Stay productive_while_slicing_up_the_monolithStay productive_while_slicing_up_the_monolith
Stay productive_while_slicing_up_the_monolith
 
Virtualizing Tier One Applications - Varrow
Virtualizing Tier One Applications - VarrowVirtualizing Tier One Applications - Varrow
Virtualizing Tier One Applications - Varrow
 
Varrow Q4 Lunch & Learn Presentation - Virtualizing Business Critical Applica...
Varrow Q4 Lunch & Learn Presentation - Virtualizing Business Critical Applica...Varrow Q4 Lunch & Learn Presentation - Virtualizing Business Critical Applica...
Varrow Q4 Lunch & Learn Presentation - Virtualizing Business Critical Applica...
 
Boosting the Performance of your Rails Apps
Boosting the Performance of your Rails AppsBoosting the Performance of your Rails Apps
Boosting the Performance of your Rails Apps
 
Database Virtualization: The Next Wave of Big Data
Database Virtualization: The Next Wave of Big DataDatabase Virtualization: The Next Wave of Big Data
Database Virtualization: The Next Wave of Big Data
 
Marketing Automation at Scale: How Marketo Solved Key Data Management Challen...
Marketing Automation at Scale: How Marketo Solved Key Data Management Challen...Marketing Automation at Scale: How Marketo Solved Key Data Management Challen...
Marketing Automation at Scale: How Marketo Solved Key Data Management Challen...
 
SOA with Zend Framework
SOA with Zend FrameworkSOA with Zend Framework
SOA with Zend Framework
 
Azure SQL Database for the SQL Server DBA - Azure Bootcamp Athens 2018
Azure SQL Database for the SQL Server DBA - Azure Bootcamp Athens 2018 Azure SQL Database for the SQL Server DBA - Azure Bootcamp Athens 2018
Azure SQL Database for the SQL Server DBA - Azure Bootcamp Athens 2018
 
Microservices vs monolithics betabeers
Microservices vs monolithics   betabeersMicroservices vs monolithics   betabeers
Microservices vs monolithics betabeers
 
Database Management System - 2a
Database Management System - 2aDatabase Management System - 2a
Database Management System - 2a
 
Migrate a successful transactional database to azure
Migrate a successful transactional database to azureMigrate a successful transactional database to azure
Migrate a successful transactional database to azure
 
Introduction to Microservices
Introduction to MicroservicesIntroduction to Microservices
Introduction to Microservices
 
Sql server replication step by step
Sql server replication step by stepSql server replication step by step
Sql server replication step by step
 
DBA, LEVEL III TTLM Monitoring and Administering Database.docx
DBA, LEVEL III TTLM Monitoring and Administering Database.docxDBA, LEVEL III TTLM Monitoring and Administering Database.docx
DBA, LEVEL III TTLM Monitoring and Administering Database.docx
 
Building and Deploying Large Scale SSRS using Lessons Learned from Customer D...
Building and Deploying Large Scale SSRS using Lessons Learned from Customer D...Building and Deploying Large Scale SSRS using Lessons Learned from Customer D...
Building and Deploying Large Scale SSRS using Lessons Learned from Customer D...
 

Recently uploaded

UiPath Studio Web workshop series - Day 7
UiPath Studio Web workshop series - Day 7UiPath Studio Web workshop series - Day 7
UiPath Studio Web workshop series - Day 7DianaGray10
 
UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...
UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...
UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...UbiTrack UK
 
Artificial Intelligence & SEO Trends for 2024
Artificial Intelligence & SEO Trends for 2024Artificial Intelligence & SEO Trends for 2024
Artificial Intelligence & SEO Trends for 2024D Cloud Solutions
 
Igniting Next Level Productivity with AI-Infused Data Integration Workflows
Igniting Next Level Productivity with AI-Infused Data Integration WorkflowsIgniting Next Level Productivity with AI-Infused Data Integration Workflows
Igniting Next Level Productivity with AI-Infused Data Integration WorkflowsSafe Software
 
Using IESVE for Loads, Sizing and Heat Pump Modeling to Achieve Decarbonization
Using IESVE for Loads, Sizing and Heat Pump Modeling to Achieve DecarbonizationUsing IESVE for Loads, Sizing and Heat Pump Modeling to Achieve Decarbonization
Using IESVE for Loads, Sizing and Heat Pump Modeling to Achieve DecarbonizationIES VE
 
VoIP Service and Marketing using Odoo and Asterisk PBX
VoIP Service and Marketing using Odoo and Asterisk PBXVoIP Service and Marketing using Odoo and Asterisk PBX
VoIP Service and Marketing using Odoo and Asterisk PBXTarek Kalaji
 
COMPUTER 10: Lesson 7 - File Storage and Online Collaboration
COMPUTER 10: Lesson 7 - File Storage and Online CollaborationCOMPUTER 10: Lesson 7 - File Storage and Online Collaboration
COMPUTER 10: Lesson 7 - File Storage and Online Collaborationbruanjhuli
 
Connector Corner: Extending LLM automation use cases with UiPath GenAI connec...
Connector Corner: Extending LLM automation use cases with UiPath GenAI connec...Connector Corner: Extending LLM automation use cases with UiPath GenAI connec...
Connector Corner: Extending LLM automation use cases with UiPath GenAI connec...DianaGray10
 
Introduction to Matsuo Laboratory (ENG).pptx
Introduction to Matsuo Laboratory (ENG).pptxIntroduction to Matsuo Laboratory (ENG).pptx
Introduction to Matsuo Laboratory (ENG).pptxMatsuo Lab
 
Building Your Own AI Instance (TBLC AI )
Building Your Own AI Instance (TBLC AI )Building Your Own AI Instance (TBLC AI )
Building Your Own AI Instance (TBLC AI )Brian Pichman
 
AI You Can Trust - Ensuring Success with Data Integrity Webinar
AI You Can Trust - Ensuring Success with Data Integrity WebinarAI You Can Trust - Ensuring Success with Data Integrity Webinar
AI You Can Trust - Ensuring Success with Data Integrity WebinarPrecisely
 
KubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCost
KubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCostKubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCost
KubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCostMatt Ray
 
COMPUTER 10 Lesson 8 - Building a Website
COMPUTER 10 Lesson 8 - Building a WebsiteCOMPUTER 10 Lesson 8 - Building a Website
COMPUTER 10 Lesson 8 - Building a Websitedgelyza
 
UiPath Community: AI for UiPath Automation Developers
UiPath Community: AI for UiPath Automation DevelopersUiPath Community: AI for UiPath Automation Developers
UiPath Community: AI for UiPath Automation DevelopersUiPathCommunity
 
Building AI-Driven Apps Using Semantic Kernel.pptx
Building AI-Driven Apps Using Semantic Kernel.pptxBuilding AI-Driven Apps Using Semantic Kernel.pptx
Building AI-Driven Apps Using Semantic Kernel.pptxUdaiappa Ramachandran
 
Secure your environment with UiPath and CyberArk technologies - Session 1
Secure your environment with UiPath and CyberArk technologies - Session 1Secure your environment with UiPath and CyberArk technologies - Session 1
Secure your environment with UiPath and CyberArk technologies - Session 1DianaGray10
 
OpenShift Commons Paris - Choose Your Own Observability Adventure
OpenShift Commons Paris - Choose Your Own Observability AdventureOpenShift Commons Paris - Choose Your Own Observability Adventure
OpenShift Commons Paris - Choose Your Own Observability AdventureEric D. Schabell
 
Cybersecurity Workshop #1.pptx
Cybersecurity Workshop #1.pptxCybersecurity Workshop #1.pptx
Cybersecurity Workshop #1.pptxGDSC PJATK
 
20230202 - Introduction to tis-py
20230202 - Introduction to tis-py20230202 - Introduction to tis-py
20230202 - Introduction to tis-pyJamie (Taka) Wang
 

Recently uploaded (20)

UiPath Studio Web workshop series - Day 7
UiPath Studio Web workshop series - Day 7UiPath Studio Web workshop series - Day 7
UiPath Studio Web workshop series - Day 7
 
UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...
UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...
UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...
 
Artificial Intelligence & SEO Trends for 2024
Artificial Intelligence & SEO Trends for 2024Artificial Intelligence & SEO Trends for 2024
Artificial Intelligence & SEO Trends for 2024
 
Igniting Next Level Productivity with AI-Infused Data Integration Workflows
Igniting Next Level Productivity with AI-Infused Data Integration WorkflowsIgniting Next Level Productivity with AI-Infused Data Integration Workflows
Igniting Next Level Productivity with AI-Infused Data Integration Workflows
 
Using IESVE for Loads, Sizing and Heat Pump Modeling to Achieve Decarbonization
Using IESVE for Loads, Sizing and Heat Pump Modeling to Achieve DecarbonizationUsing IESVE for Loads, Sizing and Heat Pump Modeling to Achieve Decarbonization
Using IESVE for Loads, Sizing and Heat Pump Modeling to Achieve Decarbonization
 
VoIP Service and Marketing using Odoo and Asterisk PBX
VoIP Service and Marketing using Odoo and Asterisk PBXVoIP Service and Marketing using Odoo and Asterisk PBX
VoIP Service and Marketing using Odoo and Asterisk PBX
 
COMPUTER 10: Lesson 7 - File Storage and Online Collaboration
COMPUTER 10: Lesson 7 - File Storage and Online CollaborationCOMPUTER 10: Lesson 7 - File Storage and Online Collaboration
COMPUTER 10: Lesson 7 - File Storage and Online Collaboration
 
Connector Corner: Extending LLM automation use cases with UiPath GenAI connec...
Connector Corner: Extending LLM automation use cases with UiPath GenAI connec...Connector Corner: Extending LLM automation use cases with UiPath GenAI connec...
Connector Corner: Extending LLM automation use cases with UiPath GenAI connec...
 
Introduction to Matsuo Laboratory (ENG).pptx
Introduction to Matsuo Laboratory (ENG).pptxIntroduction to Matsuo Laboratory (ENG).pptx
Introduction to Matsuo Laboratory (ENG).pptx
 
Building Your Own AI Instance (TBLC AI )
Building Your Own AI Instance (TBLC AI )Building Your Own AI Instance (TBLC AI )
Building Your Own AI Instance (TBLC AI )
 
AI You Can Trust - Ensuring Success with Data Integrity Webinar
AI You Can Trust - Ensuring Success with Data Integrity WebinarAI You Can Trust - Ensuring Success with Data Integrity Webinar
AI You Can Trust - Ensuring Success with Data Integrity Webinar
 
KubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCost
KubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCostKubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCost
KubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCost
 
201610817 - edge part1
201610817 - edge part1201610817 - edge part1
201610817 - edge part1
 
COMPUTER 10 Lesson 8 - Building a Website
COMPUTER 10 Lesson 8 - Building a WebsiteCOMPUTER 10 Lesson 8 - Building a Website
COMPUTER 10 Lesson 8 - Building a Website
 
UiPath Community: AI for UiPath Automation Developers
UiPath Community: AI for UiPath Automation DevelopersUiPath Community: AI for UiPath Automation Developers
UiPath Community: AI for UiPath Automation Developers
 
Building AI-Driven Apps Using Semantic Kernel.pptx
Building AI-Driven Apps Using Semantic Kernel.pptxBuilding AI-Driven Apps Using Semantic Kernel.pptx
Building AI-Driven Apps Using Semantic Kernel.pptx
 
Secure your environment with UiPath and CyberArk technologies - Session 1
Secure your environment with UiPath and CyberArk technologies - Session 1Secure your environment with UiPath and CyberArk technologies - Session 1
Secure your environment with UiPath and CyberArk technologies - Session 1
 
OpenShift Commons Paris - Choose Your Own Observability Adventure
OpenShift Commons Paris - Choose Your Own Observability AdventureOpenShift Commons Paris - Choose Your Own Observability Adventure
OpenShift Commons Paris - Choose Your Own Observability Adventure
 
Cybersecurity Workshop #1.pptx
Cybersecurity Workshop #1.pptxCybersecurity Workshop #1.pptx
Cybersecurity Workshop #1.pptx
 
20230202 - Introduction to tis-py
20230202 - Introduction to tis-py20230202 - Introduction to tis-py
20230202 - Introduction to tis-py
 

Divide & Conquer Reporting By Scaling Out with Replication

  • 1. Conquer Reporting By Scaling Out SQL Server January 16, 2013
  • 2. My Contact Information Anthony Sammartino MCITP(BI), PMP® Vice President TekPartners Business Intelligence Solutions (954) 282-1798 asammartino@tekpartners.com Twitter: @SQLAnt Linkedin: http://www.linkedin.com/in/apsammartino Blog: www.sqlant.me Web: www.tekpartnersbi.com
  • 3. About Me • Started working with SQL Server 7.0 in 1999 • 14 Data Warehouse / BI Projects in 13 Years • 11 Years SQL Server 2000, 2005, 2008(R2), 2012 • Live in South Florida with my wife and two daughters • Fan of Miami and Philadelphia Sports teams, all things technology • Solutions Architect, Project Manager, Technical Lead MCP(SQL Server), MCTS(BI), MCITP(BI), PMP®
  • 4. Session Overview 1. Case for Scaling Out SQL Server for Reporting 2. Choosing a Method to Scale Out SQL Server 3. Architecture with Reporting Scaled Out 4. Replication Server Roles 5. Replication Agents 6. Distribution Database 7. Publications, Articles, Subscriptions 8. Partitioning 9. References for Replication 10. Questions
  • 5. The "Situation" Problem Statement: A company named (House Widgets Inc.) has a main application that sells widgets online. Every time the Sales staff runs reports to see how many widgets were sold the application slows, and even times out. Sales staff complains their reports are slow. Users complain application is slow. Background: • DBA team has tuned the reports (T-SQL) through execution plans. • They also verified its using the correct indexes (Seeks). • They even resorted to dirty reads using isolation level and nolocks in the code. • Deemed the data is just to large and too busy. Thousands of users are trying to access it, change it at the same time. • Solid State Disks were even thrown at it. Helped for a short time. Resolution: • Time to think about separating the databases for the application and reporting. • Many ways to scale out SQL Server for reporting. • Many variables to think about.
  • 6. Choosing a Method to Scale Out Requirements • Requirement is to have real time reporting. • Requirement is to only report on half of the db tables. Transactional Replication…Why? • Transactional Replication happens in near real time. • Once setup, transactions flow. Other types of Replication • Snapshot: Point in time. For example once a day at 9am. Not Near real time. • Merge: Near real time but ideal for situations where two dbs need to be kept in sync with writes in two locations. Example: Bank with two branches in NY, FL. Database Mirroring • Mirroring is very easy to setup and maintain. • It’s a whole database or nothing solution. • Point in time using database snapshots. Always On Availability Groups *NEW SQL Server 2012 • Near real time transactions. • It’s a whole database or nothing solution. • Enterprise Edition needed $$$ on both Source and Replica. Service Broker • Near real time transactions. • Harder to setup and maintain, more suited for transforming data.
  • 7. Architecture with Reporting Scaled Out to a Replica Application (HouseWidgets.com) SQL Server (SQLVM03) SQL Server (SQLVM03SUBSCRIBER) Publisher Distributor & Subscriber Application Application DB- DB Distribution Replica Transactional Replication Read Only
  • 8. Replication Server Roles Publisher: The publisher is the source SQL Server that contains database objects that you wish to replicate. In this case SQLVM03. Distributor: The distributor is the server that you wish to setup to “distribute” transactions from the publisher to the subscriber server. Subscriber: The Subscriber is the server that hosts the replica database and where the reporting will be directed from the application. In this case SQLVM03Subscriber
  • 9. Secret Agents…Man • Replication creates a number of Agents. • These Agents run as jobs scheduled under SQL Server Agent. • SQL Server Agent must be turned on. • Recommend restarting options be checked, and configure SQL Server Agent with a service account with access to both machines. • Replication agents can be administered from SQL Server Replication Monitor and SQL Server Management Studio.
  • 10. More Secret Agents Snapshot Agent • Used with all types of replication. • It prepares schema and initial data files of published tables and other objects. • Records information about synchronization in the distribution database. • The Snapshot Agent runs at the Distributor. Log Reader Agent • Used with transactional replication. • Moves transactions marked for replication from the Publisher to the distribution database. Each database published using transactional replication has its own Log Reader Agent. Distribution Agent • Used with snapshot replication and transactional replication. • It applies the initial snapshot to the Subscriber and moves transactions held in the distribution database to Subscribers. • The Distribution Agent runs at either the Distributor for push subscriptions or at the Subscriber for pull subscriptions.
  • 11. More Secret Agents Merge Agent • Used with merge replication. • It applies the initial snapshot to the Subscriber and moves and reconciles incremental data changes that occur. • Each merge subscription has its own Merge Agent that connects to both the Publisher and the Subscriber and updates both. • The Merge Agent runs at either the Distributor for push subscriptions or the Subscriber for pull subscriptions. Replication Maintenance Jobs Replication has a number of maintenance jobs that perform scheduled and on-demand maintenance.
  • 12. Distribution Database Distribution DB The distribution database holds all of the transactions from the publisher database and applies them to the subscriber. Performance Tip As a general rule of thumb for smaller publisher database implementations small in size, small number of concurrent users, small number of transactions, place the distributor and subscriber on one server separate from the publisher. For larger database implementations large in size, large number of concurrent users, large number of transactions, place the distributor on its own server and the subscriber on its own server, both separate from the publisher. Always separate the distributor and subscriber from the publisher. Your goal is to take load off the publisher with this architectural solution.
  • 13. Publications, Articles, Subscriptions Publications A Publication is what is created on the Publisher server and stores articles that will be replicated. Tip: One table per publication, especially if they are large. Re-snapshot. Articles Tables, Stored Procedures, Views , Indexed Views, User Defined Functions. Subscriptions A Subscriber is what is created on the Subscriber server to receive all of the transactions of the Publication.
  • 14. Partitioning Large Tables – How to deal? • Partitioning Schemes can be propogated from the Publisher but don’t have to. • They can also be created a the subscriber entirely different better for reporting. • If you want to archive the Publishing database but keep the subscriber around you can get creative with Partition swapping. • Replication is scalable. I have replicated a 6 billion record table with good performance. A lot of partitions 
  • 15. Replication References http://www.replicationanswers.com Paul Ibison’s website full of good replication…well answers. http://www.sqlsoldier.com Robert Davis’s website and if you use the search box you can find some good stuff on replication Twitter: #sqlhelp
  • 16. Questions Thank you for your time today and hope you found this educational Anthony Sammartino MCITP(BI), PMP® Vice President TekPartners Business Intelligence Solutions (954) 282-1798 asammartino@tekpartners.com Twitter: @SQLAnt Linkedin: http://www.linkedin.com/in/apsammartino Blog: www.sqlant.me Web: www.tekpartnersbi.com