Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 Building Distributed Asynchronous Applications With SQL Service Broker Gerald Hinson, Roger Wolter DAT303 Dev Lead Microsoft Corporation.

Similar presentations


Presentation on theme: "1 Building Distributed Asynchronous Applications With SQL Service Broker Gerald Hinson, Roger Wolter DAT303 Dev Lead Microsoft Corporation."— Presentation transcript:

1 1 Building Distributed Asynchronous Applications With SQL Service Broker Gerald Hinson, Roger Wolter DAT303 Dev Lead Microsoft Corporation

2 2 Agenda What is Service Broker? Service Broker Basics CLR Services Conversation Group Locking WCF Channel Remote Service Broker

3 3 SQL Service Broker Platform for building asynchronous, loosely coupled database applications Queues are database objects Queue locking reduces conflicts and deadlocks Dialogs give unprecedented message ordering assurance Ordered across transactions, input applications and output applications New DDL and DML for messaging Use the same APIs and tools as SQL Reliable messaging for scale out

4 4 Database B Database A Dialogs Dialogs provide two-way messaging between two services Dialogs offer Guaranteed delivery Exactly-once delivery In-order delivery Secure communications Dialogs May be long-lived (years) or short-lived (seconds) Are lightweight Are persistent sessions Customer Service Travel Service Dialog

5 5 Services A Service is a named endpoint that may be targeted with messages Its interface is defined by the messages it consumes and emits Services are scoped by (live in) databases It is responsibility of a service’s Service Broker to 1) Deliver messages sent from that service to other services 2) Store messages that are sent to that service until the service can process them Every service is mapped to a Queue. Messages sent to a service are stored in its associated queue Queues are a new table-like object introduced in SS 2005 Messages are dequeued using a new verb: RECEIVE Messages may be “peeked” using SELECT

6 6 Stored Procedure Internal Activation QUEUE

7 7 Service Broker Basics Gerald Hinson Dev Lead SQL Server

8 8 Service Service External Activation QueueExternalActivator Event Queue

9 9 CLR Services Gerald Hinson Dev Lead SQL Server

10 10 Queue Reader Conversation Group Locking QUEUEDialog1 Dialog2 Dialog2 Dialog2 Dialog1 Dialog1 X

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 TDSTDS Service Broker Routing Service

13 13 WCF Channel Gerald Hinson Dev Lead SQL Server

14 14 Certificate Public Key Certificate Initiator Target FROM Service Message Header Certificate Private Key DB User Remote Service Binding DB User Authorization Certificate Private Key DB User TOService Dialog Security

15 15 Routing SEND Classifier sys.routes

16 16 Remote Service Broker Gerald Hinson Dev Lead SQL Server

17 17 Service Broker Scenarios Asynchronous DB “Stuff” Asynchronous Triggers and Events Parallel Stored Procedures Batches and scheduled tasks Data Warehouse population Delayed actions in different transactions Reliable Messaging Smart Clients Point of Sale Shop Floor Scaling out asynchronous stuff Reliable Service Oriented Architecture

18 18 Resources http://blogs.msdn.com/ rushidesai/ http://blogs.msdn.com/ rushidesai/ http://forums.microsoft.com/ msdn/ShowForum.aspx? ForumID=91 http://forums.microsoft.com/ msdn/ShowForum.aspx? ForumID=91 http://www.sqlservicebroker.com/forums/ http://www.sqlservicebroker.com/forums/ http://msdn.microsoft.com/ sql/2005/ http://msdn.microsoft.com/ sql/2005/ rwolter@microsoft.com

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.


Download ppt "1 Building Distributed Asynchronous Applications With SQL Service Broker Gerald Hinson, Roger Wolter DAT303 Dev Lead Microsoft Corporation."

Similar presentations


Ads by Google