Building Distributed Asynchronous Applications With SQL Service Broker Gerald Hinson, Roger Wolter DAT303 Dev Lead Microso...
Agenda <ul><li>What is Service Broker? </li></ul><ul><li>Service Broker Basics </li></ul><ul><li>CLR Services </li></ul><u...
SQL Service Broker <ul><li>Platform for building asynchronous, loosely coupled database applications </li></ul><ul><ul><li...
Dialogs <ul><li>Dialogs provide two-way messaging between two services </li></ul><ul><li>Dialogs offer </li></ul><ul><ul><...
Services <ul><li>A  Service  is a named endpoint that may be targeted with messages </li></ul><ul><ul><li>Its interface is...
Internal Activation Stored Procedure Stored Procedure QUEUE
Service Broker Basics Gerald Hinson Dev Lead SQL Server
External Activation Service Service External Activator Event Queue Queue
CLR Services Gerald Hinson Dev Lead SQL Server
Conversation Group Locking Queue Reader Queue Reader Dialog1 Dialog2 Dialog2 Dialog2 Dialog1 Dialog1 X QUEUE
Conversation Group Locking Gerald Hinson Dev Lead SQL Server
WCF (“Indigo”) Channel For SSB Typed Proxy SSB Channel Client ADO.NET SQL Server Dispatcher SSB Channel ADO.NET SQL Server...
WCF Channel Gerald Hinson Dev Lead SQL Server
Dialog Security Initiator Target FROM Service TO  Service Certificate Public Key Certificate Public Key Message Header Cer...
Routing SEND Classifier sys.routes
Remote Service Broker Gerald Hinson Dev Lead SQL Server
Service Broker Scenarios <ul><li>Asynchronous DB “Stuff” </li></ul><ul><ul><li>Asynchronous Triggers and Events </li></ul>...
Resources <ul><li>http://blogs.msdn.com/rushidesai/   </li></ul><ul><li>http://forums.microsoft.com/msdn/ShowForum.aspx?Fo...
© 2005 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes n...
Upcoming SlideShare
Loading in...5
×

DAT303_Hinson_Wolter.ppt

316

Published on

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
316
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
6
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide
  • ©2005 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary. 05/06/10 09:24
  • DAT303_Hinson_Wolter.ppt

    1. 1. Building Distributed Asynchronous Applications With SQL Service Broker Gerald Hinson, Roger Wolter DAT303 Dev Lead Microsoft Corporation
    2. 2. Agenda <ul><li>What is Service Broker? </li></ul><ul><li>Service Broker Basics </li></ul><ul><li>CLR Services </li></ul><ul><li>Conversation Group Locking </li></ul><ul><li>WCF Channel </li></ul><ul><li>Remote Service Broker </li></ul>
    3. 3. SQL Service Broker <ul><li>Platform for building asynchronous, loosely coupled database applications </li></ul><ul><ul><li>Queues are database objects </li></ul></ul><ul><ul><ul><li>Queue locking reduces conflicts and deadlocks </li></ul></ul></ul><ul><ul><li>Dialogs give unprecedented message ordering assurance </li></ul></ul><ul><ul><ul><li>Ordered across transactions, input applications and output applications </li></ul></ul></ul><ul><ul><li>New DDL and DML for messaging </li></ul></ul><ul><ul><ul><li>Use the same APIs and tools as SQL </li></ul></ul></ul><ul><ul><li>Reliable messaging for scale out </li></ul></ul>
    4. 4. Dialogs <ul><li>Dialogs provide two-way messaging between two services </li></ul><ul><li>Dialogs offer </li></ul><ul><ul><li>Guaranteed delivery </li></ul></ul><ul><ul><li>Exactly-once delivery </li></ul></ul><ul><ul><li>In-order delivery </li></ul></ul><ul><ul><li>Secure communications </li></ul></ul><ul><li>Dialogs </li></ul><ul><ul><li>May be long-lived (years) or short-lived (seconds) </li></ul></ul><ul><ul><li>Are lightweight </li></ul></ul><ul><ul><li>Are persistent sessions </li></ul></ul>Database B Database A Dialog Customer Service Travel Service
    5. 5. Services <ul><li>A Service is a named endpoint that may be targeted with messages </li></ul><ul><ul><li>Its interface is defined by the messages it consumes and emits </li></ul></ul><ul><ul><li>Services are scoped by (live in) databases </li></ul></ul><ul><ul><li>It is responsibility of a service’s Service Broker to </li></ul></ul><ul><ul><ul><li>1) Deliver messages sent from that service to other services </li></ul></ul></ul><ul><ul><ul><li>2) Store messages that are sent to that service until the service can process them </li></ul></ul></ul><ul><ul><ul><ul><li>Every service is mapped to a Queue . Messages sent to a service are stored in its associated queue </li></ul></ul></ul></ul><ul><ul><ul><ul><li>Queues are a new table-like object introduced in SS 2005 </li></ul></ul></ul></ul><ul><ul><ul><ul><ul><li>Messages are dequeued using a new verb: RECEIVE </li></ul></ul></ul></ul></ul><ul><ul><ul><ul><ul><li>Messages may be “peeked” using SELECT </li></ul></ul></ul></ul></ul>
    6. 6. Internal Activation Stored Procedure Stored Procedure QUEUE
    7. 7. Service Broker Basics Gerald Hinson Dev Lead SQL Server
    8. 8. External Activation Service Service External Activator Event Queue Queue
    9. 9. CLR Services Gerald Hinson Dev Lead SQL Server
    10. 10. Conversation Group Locking Queue Reader Queue Reader Dialog1 Dialog2 Dialog2 Dialog2 Dialog1 Dialog1 X QUEUE
    11. 11. Conversation Group Locking Gerald Hinson Dev Lead SQL Server
    12. 12. WCF (“Indigo”) Channel For SSB Typed Proxy SSB Channel Client ADO.NET SQL Server Dispatcher SSB Channel ADO.NET SQL Server TDS TDS Service Broker Routing Service
    13. 13. WCF Channel Gerald Hinson Dev Lead SQL Server
    14. 14. Dialog Security Initiator Target FROM Service TO Service Certificate Public Key Certificate Public Key Message Header Certificate Private Key DB User DB User RemoteService Binding DB User Authorization Certificate Private Key DB User
    15. 15. Routing SEND Classifier sys.routes
    16. 16. Remote Service Broker Gerald Hinson Dev Lead SQL Server
    17. 17. Service Broker Scenarios <ul><li>Asynchronous DB “Stuff” </li></ul><ul><ul><li>Asynchronous Triggers and Events </li></ul></ul><ul><ul><li>Parallel Stored Procedures </li></ul></ul><ul><ul><li>Batches and scheduled tasks </li></ul></ul><ul><ul><li>Data Warehouse population </li></ul></ul><ul><ul><li>Delayed actions in different transactions </li></ul></ul><ul><li>Reliable Messaging </li></ul><ul><ul><li>Smart Clients </li></ul></ul><ul><ul><li>Point of Sale </li></ul></ul><ul><ul><li>Shop Floor </li></ul></ul><ul><ul><li>Scaling out asynchronous stuff </li></ul></ul><ul><li>Reliable Service Oriented Architecture </li></ul>
    18. 18. Resources <ul><li>http://blogs.msdn.com/rushidesai/ </li></ul><ul><li>http://forums.microsoft.com/msdn/ShowForum.aspx?ForumID=91 </li></ul><ul><li>http://www.sqlservicebroker.com/forums/ </li></ul><ul><li>http://msdn.microsoft.com/sql/2005/ </li></ul><ul><li>[email_address] </li></ul>
    19. 19. © 2005 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.
    1. A particular slide catching your eye?

      Clipping is a handy way to collect important slides you want to go back to later.

    ×