SlideShare uma empresa Scribd logo
1 de 23
Baixar para ler offline
Service Dispatcher: The MySpace
Implementation of Service Broker
       Speaker: Christa Stelzmuller
      MySpace Chief Data Architect

      San Francisco SQL Server User Group
              September 14, 2009




         Mark Ginnebaugh, User Group Leader
                www.bayareasql.org
Christa Stelzmuller

  Chief Data Architect at MySpace since Oct 2006
  Formerly at Yahoo!
    Engineering Manager
    Data Architect for the Yahoo! Music Team
  Specializes in very large databases with high volumes
  of transactions

Tonight’s Topic: Service Dispatcher: The MySpace
Implementation of Service Broker
What is Service Broker?

Message Queue
  Asynchronous
  Unicast
  Intra- and Inter-database, instance, and server
Integrated into the database engine
  Instance level
  DML extensions
Why Service Broker?

Flexible
  Atomic transactions can be split across synchronous and
  asynchronous work items
  Work items can occur in parallel
Predictable
  Asynchronous work items are processed at a constant rate
  leveling peaks and valleys
Transactional
In-Database
  Common administration
Challenges with Service Broker

Unicast
  Communication is from a single sender to a single target
  Excessive message transmission
Routing
  Requires a physical route between each service
  Unmanageable number of routes
Non-Intuitive
  Four object types must be implemented for each service,
  and up to seven understood
  High learning curve for average database developer
Introducing Service Dispatcher
Core Features
 Simulated Multicast
   Communication is from a single sender to a specified set of
   targets
   Wildcard targets support simulated broadcast
 Route Management
   Routes to all dispatcher client enabled databases are
   managed centrally
 Abstraction
   API for “SEND”
   Friendly database names are used instead of service
   broker instances
Advanced Features
 Dialog Management
   Technique of dialog reuse abstracted
   Pooling based on spid, service, and group
 Route Receipts
   Used in simulated broadcast scenarios to return information
   on all servers from which acknowledgement should be
   expected
 Extensible
   Publish/Subscribe (target agnostic messages)
   Notifications
Major Use Cases
  Broker Gateway
    Asynchronous message
    delivery APIs
    Load balanced farm
    Abstracted data destination
  Example Usage
    Activities Stream
Major Use Cases

Backend Initiated
Processing
  Foreign keys and
  relationships spread across
  many databases
  Coordinated messaging
Example Usage
  Profile management
  Content take-downs
Major Use Cases

List Broadcast
  Local data used to broadcast
  updates to lists
  Two views of the relationship
  represented
Example Usage
  Photo Tags
  Friend Categories
Developer Highlights

Message Types
  No need for explicit service broker message types
  If needed, application message types are supported as
  part of the message body
  Standard set of message types, system and dispatcher
Contracts
  No need for explicit service broker contracts
  Each application service must contain a reference to at
  least one dispatcher contract
Developer Highlights

Conversation Group Locking
  Alternative to GET CONVERSATION GROUP
  Dialog consolidation for performance
  Requires explicit conversation group lock release
Conversation Ending
  Dispatcher specific state tables
  Error handling
Administrator Highlights

Build
  Central catalog
  Common client code deployed
  Automated services
    Dispatcher route creation
    Client route creation
Database Configuration
  GET CONVERSATION GROUP
  Maximum valid groups
  Dialog pool size
  Dialog timeout settings
Administrator Highlights

Health & Monitoring
  Reports
    Scheduled
    Ad-Hoc
  Notifications
  Automated queue reactivation
  Quarantine
  Ping
Unsupported Broker Features

Message Ordering
  Farm of servers, random access
  Dialog death & resend
  Abstracted conversation management
Fire & Forget
  Conversation management is tightly controlled by
  dispatcher, and logic to properly handle conversation ends
  and errors is built in.
Begin/End Conversation
  Applications cannot control dialog state, this is entirely
  managed by dispatcher
Upcoming Features

Dialog Emulation
  Introducing the concept of circuits
  Message sequence number
  Message ordering becomes possible
  Applications can control circuit state
Abstracted activation logic
  RECEIVE logic abstracted
  Internal broker message type handling
Service Broker Stats
                     Average        Average Peak          Max          Peak Farm Total
    MySpace DB   Sends/Sec/Server Sends/Sec/Server Sends/Sec/Server      Sends/Sec
Dispatcher             45                229               816              9,164
Profile                90                258               925             130,290
Mail                   40               2,397             8,546           1,210,485
Shared                 264               540                -                 -
Features               21                36                37                720


                     Average        Average Peak          Max          Peak Farm Total
    MySpace DB   Rcvs/Sec/Server   Rcvs/Sec/Server   Rcvs/Sec/Server    Receives/Sec
Dispatcher             10                33                48               1,328
Profile                60                303               432             153,015
Mail                   38               3,186             4,980           1,608,930
Shared                 218               351                -                 -
Features               18                92                119              1,840
When not to use Dispatcher

Local asynchronous messages
One-to-one messaging
When an unsupported feature is required
Alternatives to Dispatcher

Abstracted SEND logic (same as dispatcher without the
router component)
Dynamic route management (Microsoft’s solution
More Information

Case Study
  http://www.microsoft.com/casestudies/Case_Study_Detail.
  aspx?CaseStudyID=4000004532


Codeplex
  Soon to come!
Credits

Creator & Original Concept, Mikhail Berlyant
Principal Dispatcher Architect, Mark Lovretovich
Contributors, Kevin Stephenson & Justin Engelman
To learn more or inquire about speaking opportunities, please
                           contact:

Mark Ginnebaugh, User Group Leader mark@designmind.com

Mais conteúdo relacionado

Mais procurados

When Encryption is Not Enough...Sumanth Naropanth, Chandra Prakash Gopalaiah ...
When Encryption is Not Enough...Sumanth Naropanth, Chandra Prakash Gopalaiah ...When Encryption is Not Enough...Sumanth Naropanth, Chandra Prakash Gopalaiah ...
When Encryption is Not Enough...Sumanth Naropanth, Chandra Prakash Gopalaiah ...
Shakacon
 
Cheque truncation system (cts)
Cheque truncation system (cts)Cheque truncation system (cts)
Cheque truncation system (cts)
SangitaChina1
 
Es_module2ppt.pptx
Es_module2ppt.pptxEs_module2ppt.pptx
Es_module2ppt.pptx
RohanAM1
 

Mais procurados (16)

Dbms notes
Dbms notesDbms notes
Dbms notes
 
Backup and recovery
Backup and recoveryBackup and recovery
Backup and recovery
 
Nfs
NfsNfs
Nfs
 
Electronic fund transfer system
Electronic fund transfer systemElectronic fund transfer system
Electronic fund transfer system
 
Electronic clearing service (ecs)
Electronic clearing service (ecs)Electronic clearing service (ecs)
Electronic clearing service (ecs)
 
When Encryption is Not Enough...Sumanth Naropanth, Chandra Prakash Gopalaiah ...
When Encryption is Not Enough...Sumanth Naropanth, Chandra Prakash Gopalaiah ...When Encryption is Not Enough...Sumanth Naropanth, Chandra Prakash Gopalaiah ...
When Encryption is Not Enough...Sumanth Naropanth, Chandra Prakash Gopalaiah ...
 
Administering and configuring System Center Configuration Manager 2012 R2 SP1
Administering and configuring System Center Configuration Manager 2012 R2 SP1Administering and configuring System Center Configuration Manager 2012 R2 SP1
Administering and configuring System Center Configuration Manager 2012 R2 SP1
 
08. networking
08. networking08. networking
08. networking
 
History of money
History of money History of money
History of money
 
Task management System (TMS)
Task management System (TMS)Task management System (TMS)
Task management System (TMS)
 
Introduction to Database Management System
Introduction to Database Management SystemIntroduction to Database Management System
Introduction to Database Management System
 
Basics of Banking in the U.S.
Basics of Banking in the U.S.Basics of Banking in the U.S.
Basics of Banking in the U.S.
 
Case tools
Case tools Case tools
Case tools
 
MeetUp: Kerberos - Protocol for Authentication & Authorization @Criteo
MeetUp: Kerberos - Protocol for Authentication & Authorization @CriteoMeetUp: Kerberos - Protocol for Authentication & Authorization @Criteo
MeetUp: Kerberos - Protocol for Authentication & Authorization @Criteo
 
Cheque truncation system (cts)
Cheque truncation system (cts)Cheque truncation system (cts)
Cheque truncation system (cts)
 
Es_module2ppt.pptx
Es_module2ppt.pptxEs_module2ppt.pptx
Es_module2ppt.pptx
 

Destaque

Distributed web based systems
Distributed web based systemsDistributed web based systems
Distributed web based systems
Reza Gh
 

Destaque (7)

MySpace Data Architecture June 2009
MySpace Data Architecture June 2009MySpace Data Architecture June 2009
MySpace Data Architecture June 2009
 
SQL Server -Service Broker - Reliable Messaging
SQL Server -Service Broker - Reliable MessagingSQL Server -Service Broker - Reliable Messaging
SQL Server -Service Broker - Reliable Messaging
 
Widget Summit 2008: Powering Your Site with Data Availability
Widget Summit 2008: Powering Your Site with Data AvailabilityWidget Summit 2008: Powering Your Site with Data Availability
Widget Summit 2008: Powering Your Site with Data Availability
 
Myspace: Growth, Collapse, and Reinvention
Myspace: Growth, Collapse, and ReinventionMyspace: Growth, Collapse, and Reinvention
Myspace: Growth, Collapse, and Reinvention
 
SQL Server Service Brokers
SQL Server Service BrokersSQL Server Service Brokers
SQL Server Service Brokers
 
Distributed web based systems
Distributed web based systemsDistributed web based systems
Distributed web based systems
 
Social Networking Project (website) full documentation
Social Networking Project (website) full documentation Social Networking Project (website) full documentation
Social Networking Project (website) full documentation
 

Semelhante a MySpace SQL Server Service Broker

MMS Profile for Web Services
MMS Profile for Web ServicesMMS Profile for Web Services
MMS Profile for Web Services
Abhijeet Ranadive
 
MOSS 2007 Deployment Fundamentals -Part2
MOSS 2007 Deployment Fundamentals -Part2MOSS 2007 Deployment Fundamentals -Part2
MOSS 2007 Deployment Fundamentals -Part2
Information Technology
 
NaradaBrokering Grid Messaging and Applications as Web Services
NaradaBrokering Grid Messaging and Applications as Web ServicesNaradaBrokering Grid Messaging and Applications as Web Services
NaradaBrokering Grid Messaging and Applications as Web Services
Videoguy
 
NaradaBrokering Grid Messaging and Applications as Web Services
NaradaBrokering Grid Messaging and Applications as Web ServicesNaradaBrokering Grid Messaging and Applications as Web Services
NaradaBrokering Grid Messaging and Applications as Web Services
Videoguy
 
Part 1 network computing
Part 1 network computingPart 1 network computing
Part 1 network computing
Linh Nguyen
 

Semelhante a MySpace SQL Server Service Broker (20)

High volume real time contiguous etl and audit
High volume real time contiguous etl and auditHigh volume real time contiguous etl and audit
High volume real time contiguous etl and audit
 
Running a Megasite on Microsoft Technologies
Running a Megasite on Microsoft TechnologiesRunning a Megasite on Microsoft Technologies
Running a Megasite on Microsoft Technologies
 
Handling Data in Mega Scale Systems
Handling Data in Mega Scale SystemsHandling Data in Mega Scale Systems
Handling Data in Mega Scale Systems
 
Gib 2021 - Intro to BizTalk Migrator
Gib 2021 - Intro to BizTalk MigratorGib 2021 - Intro to BizTalk Migrator
Gib 2021 - Intro to BizTalk Migrator
 
Evolution of Big Data Messaging
Evolution of Big Data Messaging Evolution of Big Data Messaging
Evolution of Big Data Messaging
 
MMS Profile for Web Services
MMS Profile for Web ServicesMMS Profile for Web Services
MMS Profile for Web Services
 
SharePoint 2010 Global Deployment
SharePoint 2010 Global DeploymentSharePoint 2010 Global Deployment
SharePoint 2010 Global Deployment
 
SOA patterns
SOA patterns SOA patterns
SOA patterns
 
Introduction To Cloud Computing
Introduction To Cloud ComputingIntroduction To Cloud Computing
Introduction To Cloud Computing
 
MOSS 2007 Deployment Fundamentals -Part2
MOSS 2007 Deployment Fundamentals -Part2MOSS 2007 Deployment Fundamentals -Part2
MOSS 2007 Deployment Fundamentals -Part2
 
Messaging for IoT
Messaging for IoTMessaging for IoT
Messaging for IoT
 
NaradaBrokering Grid Messaging and Applications as Web Services
NaradaBrokering Grid Messaging and Applications as Web ServicesNaradaBrokering Grid Messaging and Applications as Web Services
NaradaBrokering Grid Messaging and Applications as Web Services
 
NaradaBrokering Grid Messaging and Applications as Web Services
NaradaBrokering Grid Messaging and Applications as Web ServicesNaradaBrokering Grid Messaging and Applications as Web Services
NaradaBrokering Grid Messaging and Applications as Web Services
 
IoT, connecting apps, devices and services
IoT, connecting apps, devices and servicesIoT, connecting apps, devices and services
IoT, connecting apps, devices and services
 
MPLS ppt
MPLS pptMPLS ppt
MPLS ppt
 
Part 1 network computing
Part 1 network computingPart 1 network computing
Part 1 network computing
 
Implementing Domain Events with Kafka
Implementing Domain Events with KafkaImplementing Domain Events with Kafka
Implementing Domain Events with Kafka
 
WSO2Con USA 2015: WSO2 Integration Platform Deep Dive
WSO2Con USA 2015: WSO2 Integration Platform Deep DiveWSO2Con USA 2015: WSO2 Integration Platform Deep Dive
WSO2Con USA 2015: WSO2 Integration Platform Deep Dive
 
The sFlow Standard: Scalable, Unified Monitoring of Networks, Systems and App...
The sFlow Standard: Scalable, Unified Monitoring of Networks, Systems and App...The sFlow Standard: Scalable, Unified Monitoring of Networks, Systems and App...
The sFlow Standard: Scalable, Unified Monitoring of Networks, Systems and App...
 
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...
 

Mais de Mark Ginnebaugh

Mais de Mark Ginnebaugh (20)

Automating Microsoft Power BI Creations 2015
Automating Microsoft Power BI Creations 2015Automating Microsoft Power BI Creations 2015
Automating Microsoft Power BI Creations 2015
 
Microsoft SQL Server Analysis Services (SSAS) - A Practical Introduction
Microsoft SQL Server Analysis Services (SSAS) - A Practical Introduction Microsoft SQL Server Analysis Services (SSAS) - A Practical Introduction
Microsoft SQL Server Analysis Services (SSAS) - A Practical Introduction
 
Platfora - An Analytics Sandbox In A World Of Big Data
Platfora - An Analytics Sandbox In A World Of Big DataPlatfora - An Analytics Sandbox In A World Of Big Data
Platfora - An Analytics Sandbox In A World Of Big Data
 
Microsoft SQL Server Relational Databases and Primary Keys
Microsoft SQL Server Relational Databases and Primary KeysMicrosoft SQL Server Relational Databases and Primary Keys
Microsoft SQL Server Relational Databases and Primary Keys
 
DesignMind Microsoft Business Intelligence SQL Server
DesignMind Microsoft Business Intelligence SQL ServerDesignMind Microsoft Business Intelligence SQL Server
DesignMind Microsoft Business Intelligence SQL Server
 
San Francisco Bay Area SQL Server July 2013 meetings
San Francisco Bay Area SQL Server July 2013 meetingsSan Francisco Bay Area SQL Server July 2013 meetings
San Francisco Bay Area SQL Server July 2013 meetings
 
Silicon Valley SQL Server User Group June 2013
Silicon Valley SQL Server User Group June 2013Silicon Valley SQL Server User Group June 2013
Silicon Valley SQL Server User Group June 2013
 
Microsoft SQL Server Continuous Integration
Microsoft SQL Server Continuous IntegrationMicrosoft SQL Server Continuous Integration
Microsoft SQL Server Continuous Integration
 
Hortonworks Big Data & Hadoop
Hortonworks Big Data & HadoopHortonworks Big Data & Hadoop
Hortonworks Big Data & Hadoop
 
Microsoft SQL Server Physical Join Operators
Microsoft SQL Server Physical Join OperatorsMicrosoft SQL Server Physical Join Operators
Microsoft SQL Server Physical Join Operators
 
Microsoft PowerPivot & Power View in Excel 2013
Microsoft PowerPivot & Power View in Excel 2013Microsoft PowerPivot & Power View in Excel 2013
Microsoft PowerPivot & Power View in Excel 2013
 
Microsoft Data Warehouse Business Intelligence Lifecycle - The Kimball Approach
Microsoft Data Warehouse Business Intelligence Lifecycle - The Kimball ApproachMicrosoft Data Warehouse Business Intelligence Lifecycle - The Kimball Approach
Microsoft Data Warehouse Business Intelligence Lifecycle - The Kimball Approach
 
Fusion-io Memory Flash for Microsoft SQL Server 2012
Fusion-io Memory Flash for Microsoft SQL Server 2012Fusion-io Memory Flash for Microsoft SQL Server 2012
Fusion-io Memory Flash for Microsoft SQL Server 2012
 
Microsoft Data Mining 2012
Microsoft Data Mining 2012Microsoft Data Mining 2012
Microsoft Data Mining 2012
 
Microsoft SQL Server PASS News August 2012
Microsoft SQL Server PASS News August 2012Microsoft SQL Server PASS News August 2012
Microsoft SQL Server PASS News August 2012
 
Business Intelligence Dashboard Design Best Practices
Business Intelligence Dashboard Design Best PracticesBusiness Intelligence Dashboard Design Best Practices
Business Intelligence Dashboard Design Best Practices
 
Microsoft Mobile Business Intelligence
Microsoft Mobile Business Intelligence Microsoft Mobile Business Intelligence
Microsoft Mobile Business Intelligence
 
Microsoft SQL Server 2012 Cloud Ready
Microsoft SQL Server 2012 Cloud ReadyMicrosoft SQL Server 2012 Cloud Ready
Microsoft SQL Server 2012 Cloud Ready
 
Microsoft SQL Server 2012 Master Data Services
Microsoft SQL Server 2012 Master Data ServicesMicrosoft SQL Server 2012 Master Data Services
Microsoft SQL Server 2012 Master Data Services
 
Microsoft SQL Server PowerPivot
Microsoft SQL Server PowerPivotMicrosoft SQL Server PowerPivot
Microsoft SQL Server PowerPivot
 

Último

Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
Enterprise Knowledge
 

Último (20)

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...
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
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
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
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
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 

MySpace SQL Server Service Broker

  • 1. Service Dispatcher: The MySpace Implementation of Service Broker Speaker: Christa Stelzmuller MySpace Chief Data Architect San Francisco SQL Server User Group September 14, 2009 Mark Ginnebaugh, User Group Leader www.bayareasql.org
  • 2. Christa Stelzmuller Chief Data Architect at MySpace since Oct 2006 Formerly at Yahoo! Engineering Manager Data Architect for the Yahoo! Music Team Specializes in very large databases with high volumes of transactions Tonight’s Topic: Service Dispatcher: The MySpace Implementation of Service Broker
  • 3. What is Service Broker? Message Queue Asynchronous Unicast Intra- and Inter-database, instance, and server Integrated into the database engine Instance level DML extensions
  • 4. Why Service Broker? Flexible Atomic transactions can be split across synchronous and asynchronous work items Work items can occur in parallel Predictable Asynchronous work items are processed at a constant rate leveling peaks and valleys Transactional In-Database Common administration
  • 5. Challenges with Service Broker Unicast Communication is from a single sender to a single target Excessive message transmission Routing Requires a physical route between each service Unmanageable number of routes Non-Intuitive Four object types must be implemented for each service, and up to seven understood High learning curve for average database developer
  • 7. Core Features Simulated Multicast Communication is from a single sender to a specified set of targets Wildcard targets support simulated broadcast Route Management Routes to all dispatcher client enabled databases are managed centrally Abstraction API for “SEND” Friendly database names are used instead of service broker instances
  • 8. Advanced Features Dialog Management Technique of dialog reuse abstracted Pooling based on spid, service, and group Route Receipts Used in simulated broadcast scenarios to return information on all servers from which acknowledgement should be expected Extensible Publish/Subscribe (target agnostic messages) Notifications
  • 9. Major Use Cases Broker Gateway Asynchronous message delivery APIs Load balanced farm Abstracted data destination Example Usage Activities Stream
  • 10. Major Use Cases Backend Initiated Processing Foreign keys and relationships spread across many databases Coordinated messaging Example Usage Profile management Content take-downs
  • 11. Major Use Cases List Broadcast Local data used to broadcast updates to lists Two views of the relationship represented Example Usage Photo Tags Friend Categories
  • 12. Developer Highlights Message Types No need for explicit service broker message types If needed, application message types are supported as part of the message body Standard set of message types, system and dispatcher Contracts No need for explicit service broker contracts Each application service must contain a reference to at least one dispatcher contract
  • 13. Developer Highlights Conversation Group Locking Alternative to GET CONVERSATION GROUP Dialog consolidation for performance Requires explicit conversation group lock release Conversation Ending Dispatcher specific state tables Error handling
  • 14. Administrator Highlights Build Central catalog Common client code deployed Automated services Dispatcher route creation Client route creation Database Configuration GET CONVERSATION GROUP Maximum valid groups Dialog pool size Dialog timeout settings
  • 15. Administrator Highlights Health & Monitoring Reports Scheduled Ad-Hoc Notifications Automated queue reactivation Quarantine Ping
  • 16. Unsupported Broker Features Message Ordering Farm of servers, random access Dialog death & resend Abstracted conversation management Fire & Forget Conversation management is tightly controlled by dispatcher, and logic to properly handle conversation ends and errors is built in. Begin/End Conversation Applications cannot control dialog state, this is entirely managed by dispatcher
  • 17. Upcoming Features Dialog Emulation Introducing the concept of circuits Message sequence number Message ordering becomes possible Applications can control circuit state Abstracted activation logic RECEIVE logic abstracted Internal broker message type handling
  • 18. Service Broker Stats Average Average Peak Max Peak Farm Total MySpace DB Sends/Sec/Server Sends/Sec/Server Sends/Sec/Server Sends/Sec Dispatcher 45 229 816 9,164 Profile 90 258 925 130,290 Mail 40 2,397 8,546 1,210,485 Shared 264 540 - - Features 21 36 37 720 Average Average Peak Max Peak Farm Total MySpace DB Rcvs/Sec/Server Rcvs/Sec/Server Rcvs/Sec/Server Receives/Sec Dispatcher 10 33 48 1,328 Profile 60 303 432 153,015 Mail 38 3,186 4,980 1,608,930 Shared 218 351 - - Features 18 92 119 1,840
  • 19. When not to use Dispatcher Local asynchronous messages One-to-one messaging When an unsupported feature is required
  • 20. Alternatives to Dispatcher Abstracted SEND logic (same as dispatcher without the router component) Dynamic route management (Microsoft’s solution
  • 21. More Information Case Study http://www.microsoft.com/casestudies/Case_Study_Detail. aspx?CaseStudyID=4000004532 Codeplex Soon to come!
  • 22. Credits Creator & Original Concept, Mikhail Berlyant Principal Dispatcher Architect, Mark Lovretovich Contributors, Kevin Stephenson & Justin Engelman
  • 23. To learn more or inquire about speaking opportunities, please contact: Mark Ginnebaugh, User Group Leader mark@designmind.com