SlideShare a Scribd company logo
1 of 26
How Microsoft protects its Network Remus Rusanu High Volume Real Time Contiguous ETL and Audit
Agenda Network Access Protection NAP Audit as implemented by Microsoft IT Service Broker in 5 slides High Availability, Scale Out and Real Time Demo Similar Projects Q&A
Network Risks Highly connected Distributed data Mobile workers Remote access  Web services Wireless Mobile smart devices
Network Access Protection Policy ValidationEvaluates company security policies and determines compliant computers (“healthy”) vs. non-compliant ones (“unhealthy”) Network RestrictionRestricts network access based on computer “health” RemediationApplies necessary updates for non-compliant computers to become compliant, “healthy”. Once healthy, the network restrictions are lifted Ongoing ComplianceChanges to the company’s security policy or to the computers compliance trigger a new evaluation of network restrictions Health Agents Windows Security Health Agent, SCCM, IPSec, Wireless, VPN, Forefront, DHCP, BitLocker
NAP Overview
NAP Modes Reporting Mode Backend receives metrics, no client impact Capture/analyze daily statistics of unhealthy vs. healthy clients Estimate impact to user base if enforcement enabled Deferred Enforcement Mode No network restrictions during the deferment period End users receive notifications when non-compliant Helpdesk contacted by end users in regards to notifications Enforced Mode Non compliant systems are quarantined. Productivity affected during quarantine. Health certificate required to access other NAP enable clients/servers
NAP Audit Network Protection Server logging: Text files SQL: exec dbo.ReportEvent @event; @event is an XML. Correlated by a session-id: Network access request (session start) Request Accepted/Request Denied Accounting information (for VPN every 10 min) The Health status is part of the second packet Status of each SHA on the computer: OS updates, firewall, anti-virus  etc
NAP Reporting Aggregate all NAP audit events into a DW Allow analysis of Compliant/Non-compliant status and evolution Reasons for non-compliance Most frequent causes of computer quarantine Efficiency of automatic remediation Forensic analysis of computers and users activity
Processing NAP Audit Events Service Broker Delivery XML Shredding Transactional Replication 47 geo-distributed  NPS Servers Local ReportEvent Mirrored Publication Mirroring allows for Maintenance Downtimes Mirrored Routes
A Crash Course on Service Broker Message based communication between SQL Server instances SEND is a T-SQL verb to send a message SEND ON CONVERSATION @handle (‘Hello, World’); RECEIVE is a T-SQL verb to receive messages Conversations are message exchange sessions Durable, persisted in the database Long lived, can be reused for days, years BEGIN CONVERSATION starts a conversation END CONVERSATION ends a conversation Any message belongs to exactly one conversation Order of delivery is guaranteed within a conversation
A Service Broker Application
The small print: all the Broker Objects Service An addressable Broker destination. Think mailing address. Message Types, Contracts Formalize the messages a Service can accept.  Think COM Interfaces. Queues Where a Service keeps its messages until they are Received. Think mailbox. Remote Service Bindings Associate a targeted service with an identity (certificate) ‘when you send to service Foo, encrypt the data with certificate Bar’ Routes Specify the physical location of a Service.  Think Post Master. Endpoints Configure the communication protocol to be used TCP listener port Authentication and authorization Encryption scheme Allows two SQL Server instances to connect
The Nugget: Activation Attach a stored procedure to a Service Broker Queue Will run when there are messages in the queue Will run a stored procedure inside SQL Server No external connection required Fully contained within the database No external process No msdb configuration No SQL Agent requirement Magically tunes itself to the load Launches new procedure instances as needed WAITFOR (RECEIVE …) is internationally LIFO When load is reduced, procedures timeout and exit Transactional semantics Will launch after a server shutdown and restart Will launch after a mirroring failover Will launch after a cluster failover Will launch after an attach or a restore The Server can crash and burn the procedure will launch when your DR procedure is complete
Local Availability: SQL Express If the NPS Server is running, the SQL Express is likely running too Express is light on resource usage  Single CPU 1 GB RAM buffer pool 4Gb (10GB in R2) DB size Transact-SQL programming Cheap to distribute to hundreds of sites
Reliable Delivery: Service Broker SEND is a local transaction Never affected by the target availability Guarantees Exactly Once In Order delivery Handles retries Target downtime Connection problems can be resolved day, months even years after occurred without data loss Security can traverse domains NTLM/Kerberos  Certificates Authentication, Authorization, Encryption handled at SQL endpoint configuration level
Scale Out: Service Broker Hundreds and thousands of peers EdConhandles +1500 data sources Abstracts physical location with ROUTEs Server relocation Heterogeneous SQL 2005/SQL 2008 Rolling upgrade of the deployed servers Available on all editions including Express High Throughput Spikes can be delivered at +6000 msgs/sec  Highly optimized code path to insert into target
Process XML: XPath and Activation Service Broker Internal Activation readers launched when messages arrive Self-tuning reader count MAX_QUEUE_READERS No pulling! XML payload projected into columns  XPath XQuery Automatic processing batching RECEIVE TOP 1000 creates a 1000 size batch to process Correlation awareness  NPS packets 1 (Start) and 2/3 (Accept/Reject) processed by the same reader Original order is preserved during processing
DW: Transactional Replication Isolate the XML shredding from reporting Different indexes for processing vs. reporting Processing server delete data after 10 days DW retains 1 year of data (~1.5 TB) Transactional Replication Preserves order of operations Preserves transaction boundaries Easy to deploy and manage between few peers Supports mirrored publishers
Availability: Mirroring Activation processing is entirely DB contained No msdb jobs, no master dependencies Transactional consistent  Automatically starts up on new host after failover Service Broker Routing is mirroring aware CREATE ROUTE … WITH ADDRESS = ‘tcp://principalname’,MIRROR_ADDRESS = ‘tcp://mirorrname’; Will instantly follow a failover Mirroring allows for maintenance to occur Apply CU and SP Apply OS patches
DEMO
Similar Projects Real Time Analytics with SQL Server 2008 R2 StreamInsight Silverlight media content delivery metrics nbcolympics.com, March Madness Real Time metrics with R2 StreamInsight Trends and analysis in DW Aggregated with Service Broker Processed with Activation SSIS for upload into DW
Silverlight Metrics Collection WCF to reportUsage Metrics StreamInsight Real Time Service Broker Local SEND Silverlight media player Activation Processing SSIS Extraction into OLAP DW
Critical for Performance Reuse Broker conversations Each SEND on its own conversation: ~15 writes into 6 tables (for a full round-trip) SEND on an existing conversation: 2 writes on 2 tables RECEIVE cannot batch process messages on distinct conversations
Gotchas Mirroring support for DB master key sp_control_dbmasterkey_password Allows Service Broker to open the database master key on the new principal, after a failover Mirroring and Service Broker routes If the mirroring session is suspended, rotes must be modified Replication and mirroring Only publisher can be mirrored Principal and Mirror must share the same distributor –PublisherFailoverPartner parameter added to the Log Reader agent Replication and SQL 2008 Upgrade rollout Publisher version must be less than Distributor version SQL Express is the have-not of monitoring No Data Collection Sets support
Acknowledgements Tom Baker, Senior SE Systems Engineer Roger Doherty, Senior Technical Evangelist
Q&A slideshare.net/rusanu @rusanu

More Related Content

What's hot

What's hot (20)

Large Scale Deployment of SOA-P
Large Scale Deployment of SOA-PLarge Scale Deployment of SOA-P
Large Scale Deployment of SOA-P
 
Overture carrier classorchestration_sd_nandnfv_ctopraysonpate_10-2013
Overture carrier classorchestration_sd_nandnfv_ctopraysonpate_10-2013Overture carrier classorchestration_sd_nandnfv_ctopraysonpate_10-2013
Overture carrier classorchestration_sd_nandnfv_ctopraysonpate_10-2013
 
Designing apps for resiliency
Designing apps for resiliencyDesigning apps for resiliency
Designing apps for resiliency
 
Etl, esb, mq? no! es Apache Kafka®
Etl, esb, mq?  no! es Apache Kafka®Etl, esb, mq?  no! es Apache Kafka®
Etl, esb, mq? no! es Apache Kafka®
 
Data Pipelines with Apache Kafka
Data Pipelines with Apache KafkaData Pipelines with Apache Kafka
Data Pipelines with Apache Kafka
 
Redis and Kafka - Simplifying Advanced Design Patterns within Microservices A...
Redis and Kafka - Simplifying Advanced Design Patterns within Microservices A...Redis and Kafka - Simplifying Advanced Design Patterns within Microservices A...
Redis and Kafka - Simplifying Advanced Design Patterns within Microservices A...
 
CloudStack Scalability
CloudStack ScalabilityCloudStack Scalability
CloudStack Scalability
 
Designing microservices
Designing microservicesDesigning microservices
Designing microservices
 
Jay Kreps, Confluent | Kafka Summit SF 2019 Keynote ft. Dev Tagare, Lyft + Pr...
Jay Kreps, Confluent | Kafka Summit SF 2019 Keynote ft. Dev Tagare, Lyft + Pr...Jay Kreps, Confluent | Kafka Summit SF 2019 Keynote ft. Dev Tagare, Lyft + Pr...
Jay Kreps, Confluent | Kafka Summit SF 2019 Keynote ft. Dev Tagare, Lyft + Pr...
 
A Day in the Life of a Metro-veloper
A Day in the Life of a Metro-veloperA Day in the Life of a Metro-veloper
A Day in the Life of a Metro-veloper
 
Going Serverless on AWS
Going Serverless on AWSGoing Serverless on AWS
Going Serverless on AWS
 
Psdot 15 performance analysis of cloud computing
Psdot 15 performance analysis of cloud computingPsdot 15 performance analysis of cloud computing
Psdot 15 performance analysis of cloud computing
 
Grinding the java monolith
Grinding the java monolithGrinding the java monolith
Grinding the java monolith
 
Uncoupling
UncouplingUncoupling
Uncoupling
 
Migration of Microsoft Workloads
Migration of Microsoft WorkloadsMigration of Microsoft Workloads
Migration of Microsoft Workloads
 
Hard Truths About Streaming and Eventing (Dan Rosanova, Microsoft) Kafka Summ...
Hard Truths About Streaming and Eventing (Dan Rosanova, Microsoft) Kafka Summ...Hard Truths About Streaming and Eventing (Dan Rosanova, Microsoft) Kafka Summ...
Hard Truths About Streaming and Eventing (Dan Rosanova, Microsoft) Kafka Summ...
 
Event Driven Architecture
Event Driven ArchitectureEvent Driven Architecture
Event Driven Architecture
 
Event driven architecture
Event driven architectureEvent driven architecture
Event driven architecture
 
Microservices, Monoliths, SOA and How We Got Here
Microservices, Monoliths, SOA and How We Got HereMicroservices, Monoliths, SOA and How We Got Here
Microservices, Monoliths, SOA and How We Got Here
 
A Year of “Testing” the Cloud for Development and Test
A Year of “Testing” the Cloud for Development and TestA Year of “Testing” the Cloud for Development and Test
A Year of “Testing” the Cloud for Development and Test
 

Viewers also liked

Using Continuous Etl With Real Time Queries To Eliminate My Sql Bottlenecks
Using Continuous Etl With Real Time Queries To Eliminate My Sql BottlenecksUsing Continuous Etl With Real Time Queries To Eliminate My Sql Bottlenecks
Using Continuous Etl With Real Time Queries To Eliminate My Sql Bottlenecks
MySQLConference
 

Viewers also liked (7)

Using Continuous Etl With Real Time Queries To Eliminate My Sql Bottlenecks
Using Continuous Etl With Real Time Queries To Eliminate My Sql BottlenecksUsing Continuous Etl With Real Time Queries To Eliminate My Sql Bottlenecks
Using Continuous Etl With Real Time Queries To Eliminate My Sql Bottlenecks
 
Processing Near Real-Time Global Vessel Data
Processing Near Real-Time Global Vessel DataProcessing Near Real-Time Global Vessel Data
Processing Near Real-Time Global Vessel Data
 
ETL DW-RealTime
ETL DW-RealTimeETL DW-RealTime
ETL DW-RealTime
 
kafka for db as postgres
kafka for db as postgreskafka for db as postgres
kafka for db as postgres
 
Hand Coding ETL Scenarios and Challenges
Hand Coding ETL Scenarios and ChallengesHand Coding ETL Scenarios and Challenges
Hand Coding ETL Scenarios and Challenges
 
Real time ETL processing using Spark streaming
Real time ETL processing using Spark streamingReal time ETL processing using Spark streaming
Real time ETL processing using Spark streaming
 
Introduction to Real-time data processing
Introduction to Real-time data processingIntroduction to Real-time data processing
Introduction to Real-time data processing
 

Similar to High volume real time contiguous etl and audit

lec3_10.ppt
lec3_10.pptlec3_10.ppt
lec3_10.ppt
ImXaib
 
SQL Azure Dec Update
SQL Azure Dec UpdateSQL Azure Dec Update
SQL Azure Dec Update
Eric Nelson
 

Similar to High volume real time contiguous etl and audit (20)

Serhiy Kalinets "Embracing architectural challenges in the modern .NET world"
Serhiy Kalinets "Embracing architectural challenges in the modern .NET world"Serhiy Kalinets "Embracing architectural challenges in the modern .NET world"
Serhiy Kalinets "Embracing architectural challenges in the modern .NET world"
 
GWAB 2015 - Data Plaraform
GWAB 2015 - Data PlaraformGWAB 2015 - Data Plaraform
GWAB 2015 - Data Plaraform
 
Transforming a Large Mission-Critical E-Commerce Platform from a Relational A...
Transforming a Large Mission-Critical E-Commerce Platform from a Relational A...Transforming a Large Mission-Critical E-Commerce Platform from a Relational A...
Transforming a Large Mission-Critical E-Commerce Platform from a Relational A...
 
Transforming a Large Mission-Critical E-Commerce Platform from a Relational A...
Transforming a Large Mission-Critical E-Commerce Platform from a Relational A...Transforming a Large Mission-Critical E-Commerce Platform from a Relational A...
Transforming a Large Mission-Critical E-Commerce Platform from a Relational A...
 
Jeffrey Richter
Jeffrey RichterJeffrey Richter
Jeffrey Richter
 
Handling Data in Mega Scale Systems
Handling Data in Mega Scale SystemsHandling Data in Mega Scale Systems
Handling Data in Mega Scale Systems
 
Introduction To Cloud Computing
Introduction To Cloud ComputingIntroduction To Cloud Computing
Introduction To Cloud Computing
 
Migrating your Databases to AWS: Deep Dive on Amazon RDS and AWS Database Mig...
Migrating your Databases to AWS: Deep Dive on Amazon RDS and AWS Database Mig...Migrating your Databases to AWS: Deep Dive on Amazon RDS and AWS Database Mig...
Migrating your Databases to AWS: Deep Dive on Amazon RDS and AWS Database Mig...
 
Continuent Tungsten - Scalable Saa S Data Management
Continuent Tungsten - Scalable Saa S Data ManagementContinuent Tungsten - Scalable Saa S Data Management
Continuent Tungsten - Scalable Saa S Data Management
 
Day Of Cloud - Windows Azure Platform
Day Of Cloud - Windows Azure PlatformDay Of Cloud - Windows Azure Platform
Day Of Cloud - Windows Azure Platform
 
lec3_10.ppt
lec3_10.pptlec3_10.ppt
lec3_10.ppt
 
Microservices: Breaking Apart the Monolith
Microservices:  Breaking Apart the Monolith Microservices:  Breaking Apart the Monolith
Microservices: Breaking Apart the Monolith
 
Introduction To .Net Compact Framework and SQL Server CE Development
Introduction To .Net Compact Framework and SQL Server CE DevelopmentIntroduction To .Net Compact Framework and SQL Server CE Development
Introduction To .Net Compact Framework and SQL Server CE Development
 
Stephane Lapointe & Alexandre Brisebois: Développer des microservices avec Se...
Stephane Lapointe & Alexandre Brisebois: Développer des microservices avec Se...Stephane Lapointe & Alexandre Brisebois: Développer des microservices avec Se...
Stephane Lapointe & Alexandre Brisebois: Développer des microservices avec Se...
 
Datavail Accelerates AWS Adoption for Sony DADC New Media Solutions PPT
 Datavail Accelerates AWS Adoption for Sony DADC New Media Solutions PPT Datavail Accelerates AWS Adoption for Sony DADC New Media Solutions PPT
Datavail Accelerates AWS Adoption for Sony DADC New Media Solutions PPT
 
Brk3288 sql server v.next with support on linux, windows and containers was...
Brk3288 sql server v.next with support on linux, windows and containers   was...Brk3288 sql server v.next with support on linux, windows and containers   was...
Brk3288 sql server v.next with support on linux, windows and containers was...
 
"The latest and greatest from Azure Service Bus", Eldert Grootenboer
"The latest and greatest from Azure Service Bus", Eldert Grootenboer"The latest and greatest from Azure Service Bus", Eldert Grootenboer
"The latest and greatest from Azure Service Bus", Eldert Grootenboer
 
SQL Azure Dec 2010 Update
SQL Azure Dec 2010 UpdateSQL Azure Dec 2010 Update
SQL Azure Dec 2010 Update
 
SQL Azure Dec Update
SQL Azure Dec UpdateSQL Azure Dec Update
SQL Azure Dec Update
 
Real Time Apps with SignalR Core
Real Time Apps with SignalR CoreReal Time Apps with SignalR Core
Real Time Apps with SignalR Core
 

Recently uploaded

Recently uploaded (20)

presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 

High volume real time contiguous etl and audit

  • 1. How Microsoft protects its Network Remus Rusanu High Volume Real Time Contiguous ETL and Audit
  • 2. Agenda Network Access Protection NAP Audit as implemented by Microsoft IT Service Broker in 5 slides High Availability, Scale Out and Real Time Demo Similar Projects Q&A
  • 3. Network Risks Highly connected Distributed data Mobile workers Remote access Web services Wireless Mobile smart devices
  • 4. Network Access Protection Policy ValidationEvaluates company security policies and determines compliant computers (“healthy”) vs. non-compliant ones (“unhealthy”) Network RestrictionRestricts network access based on computer “health” RemediationApplies necessary updates for non-compliant computers to become compliant, “healthy”. Once healthy, the network restrictions are lifted Ongoing ComplianceChanges to the company’s security policy or to the computers compliance trigger a new evaluation of network restrictions Health Agents Windows Security Health Agent, SCCM, IPSec, Wireless, VPN, Forefront, DHCP, BitLocker
  • 6. NAP Modes Reporting Mode Backend receives metrics, no client impact Capture/analyze daily statistics of unhealthy vs. healthy clients Estimate impact to user base if enforcement enabled Deferred Enforcement Mode No network restrictions during the deferment period End users receive notifications when non-compliant Helpdesk contacted by end users in regards to notifications Enforced Mode Non compliant systems are quarantined. Productivity affected during quarantine. Health certificate required to access other NAP enable clients/servers
  • 7. NAP Audit Network Protection Server logging: Text files SQL: exec dbo.ReportEvent @event; @event is an XML. Correlated by a session-id: Network access request (session start) Request Accepted/Request Denied Accounting information (for VPN every 10 min) The Health status is part of the second packet Status of each SHA on the computer: OS updates, firewall, anti-virus etc
  • 8. NAP Reporting Aggregate all NAP audit events into a DW Allow analysis of Compliant/Non-compliant status and evolution Reasons for non-compliance Most frequent causes of computer quarantine Efficiency of automatic remediation Forensic analysis of computers and users activity
  • 9. Processing NAP Audit Events Service Broker Delivery XML Shredding Transactional Replication 47 geo-distributed NPS Servers Local ReportEvent Mirrored Publication Mirroring allows for Maintenance Downtimes Mirrored Routes
  • 10. A Crash Course on Service Broker Message based communication between SQL Server instances SEND is a T-SQL verb to send a message SEND ON CONVERSATION @handle (‘Hello, World’); RECEIVE is a T-SQL verb to receive messages Conversations are message exchange sessions Durable, persisted in the database Long lived, can be reused for days, years BEGIN CONVERSATION starts a conversation END CONVERSATION ends a conversation Any message belongs to exactly one conversation Order of delivery is guaranteed within a conversation
  • 11. A Service Broker Application
  • 12. The small print: all the Broker Objects Service An addressable Broker destination. Think mailing address. Message Types, Contracts Formalize the messages a Service can accept. Think COM Interfaces. Queues Where a Service keeps its messages until they are Received. Think mailbox. Remote Service Bindings Associate a targeted service with an identity (certificate) ‘when you send to service Foo, encrypt the data with certificate Bar’ Routes Specify the physical location of a Service. Think Post Master. Endpoints Configure the communication protocol to be used TCP listener port Authentication and authorization Encryption scheme Allows two SQL Server instances to connect
  • 13. The Nugget: Activation Attach a stored procedure to a Service Broker Queue Will run when there are messages in the queue Will run a stored procedure inside SQL Server No external connection required Fully contained within the database No external process No msdb configuration No SQL Agent requirement Magically tunes itself to the load Launches new procedure instances as needed WAITFOR (RECEIVE …) is internationally LIFO When load is reduced, procedures timeout and exit Transactional semantics Will launch after a server shutdown and restart Will launch after a mirroring failover Will launch after a cluster failover Will launch after an attach or a restore The Server can crash and burn the procedure will launch when your DR procedure is complete
  • 14. Local Availability: SQL Express If the NPS Server is running, the SQL Express is likely running too Express is light on resource usage Single CPU 1 GB RAM buffer pool 4Gb (10GB in R2) DB size Transact-SQL programming Cheap to distribute to hundreds of sites
  • 15. Reliable Delivery: Service Broker SEND is a local transaction Never affected by the target availability Guarantees Exactly Once In Order delivery Handles retries Target downtime Connection problems can be resolved day, months even years after occurred without data loss Security can traverse domains NTLM/Kerberos Certificates Authentication, Authorization, Encryption handled at SQL endpoint configuration level
  • 16. Scale Out: Service Broker Hundreds and thousands of peers EdConhandles +1500 data sources Abstracts physical location with ROUTEs Server relocation Heterogeneous SQL 2005/SQL 2008 Rolling upgrade of the deployed servers Available on all editions including Express High Throughput Spikes can be delivered at +6000 msgs/sec Highly optimized code path to insert into target
  • 17. Process XML: XPath and Activation Service Broker Internal Activation readers launched when messages arrive Self-tuning reader count MAX_QUEUE_READERS No pulling! XML payload projected into columns XPath XQuery Automatic processing batching RECEIVE TOP 1000 creates a 1000 size batch to process Correlation awareness NPS packets 1 (Start) and 2/3 (Accept/Reject) processed by the same reader Original order is preserved during processing
  • 18. DW: Transactional Replication Isolate the XML shredding from reporting Different indexes for processing vs. reporting Processing server delete data after 10 days DW retains 1 year of data (~1.5 TB) Transactional Replication Preserves order of operations Preserves transaction boundaries Easy to deploy and manage between few peers Supports mirrored publishers
  • 19. Availability: Mirroring Activation processing is entirely DB contained No msdb jobs, no master dependencies Transactional consistent Automatically starts up on new host after failover Service Broker Routing is mirroring aware CREATE ROUTE … WITH ADDRESS = ‘tcp://principalname’,MIRROR_ADDRESS = ‘tcp://mirorrname’; Will instantly follow a failover Mirroring allows for maintenance to occur Apply CU and SP Apply OS patches
  • 20. DEMO
  • 21. Similar Projects Real Time Analytics with SQL Server 2008 R2 StreamInsight Silverlight media content delivery metrics nbcolympics.com, March Madness Real Time metrics with R2 StreamInsight Trends and analysis in DW Aggregated with Service Broker Processed with Activation SSIS for upload into DW
  • 22. Silverlight Metrics Collection WCF to reportUsage Metrics StreamInsight Real Time Service Broker Local SEND Silverlight media player Activation Processing SSIS Extraction into OLAP DW
  • 23. Critical for Performance Reuse Broker conversations Each SEND on its own conversation: ~15 writes into 6 tables (for a full round-trip) SEND on an existing conversation: 2 writes on 2 tables RECEIVE cannot batch process messages on distinct conversations
  • 24. Gotchas Mirroring support for DB master key sp_control_dbmasterkey_password Allows Service Broker to open the database master key on the new principal, after a failover Mirroring and Service Broker routes If the mirroring session is suspended, rotes must be modified Replication and mirroring Only publisher can be mirrored Principal and Mirror must share the same distributor –PublisherFailoverPartner parameter added to the Log Reader agent Replication and SQL 2008 Upgrade rollout Publisher version must be less than Distributor version SQL Express is the have-not of monitoring No Data Collection Sets support
  • 25. Acknowledgements Tom Baker, Senior SE Systems Engineer Roger Doherty, Senior Technical Evangelist