DAT325 SQL Server 2005 (Codenamed “Yukon”): Using the Service Broker To Build Asynchronous,...

35

Transcript of DAT325 SQL Server 2005 (Codenamed “Yukon”): Using the Service Broker To Build Asynchronous,...

Page 1: DAT325 SQL Server 2005 (Codenamed “Yukon”): Using the Service Broker To Build Asynchronous, Queued Database Applications Roger Wolter Program Manager.
Page 2: DAT325 SQL Server 2005 (Codenamed “Yukon”): Using the Service Broker To Build Asynchronous, Queued Database Applications Roger Wolter Program Manager.

DAT325

SQL Server 2005 (Codenamed “Yukon”): Using the Service Broker To Build Asynchronous, Queued Database Applications

DAT325

SQL Server 2005 (Codenamed “Yukon”): Using the Service Broker To Build Asynchronous, Queued Database Applications

Roger WolterRoger WolterProgram ManagerProgram ManagerMicrosoftMicrosoft

Page 3: DAT325 SQL Server 2005 (Codenamed “Yukon”): Using the Service Broker To Build Asynchronous, Queued Database Applications Roger Wolter Program Manager.

Yukon Service BrokerYukon Service Broker

What is Service BrokerWhat is Service Broker

Why do asynchronous queued operations?Why do asynchronous queued operations?

Why are queued applications hard to write?Why are queued applications hard to write?

Why do messaging in the database?Why do messaging in the database?

ScenariosScenarios

Page 4: DAT325 SQL Server 2005 (Codenamed “Yukon”): Using the Service Broker To Build Asynchronous, Queued Database Applications Roger Wolter Program Manager.

What Is Service Broker?What Is Service Broker?

Platform for building asynchronous Platform for building asynchronous queued database applicationsqueued database applications

Queues as first class database objectsQueues as first class database objects

Queue manipulation built into TSQLQueue manipulation built into TSQL

Transactional message processingTransactional message processing

Reliable distributed queuingReliable distributed queuing

Page 5: DAT325 SQL Server 2005 (Codenamed “Yukon”): Using the Service Broker To Build Asynchronous, Queued Database Applications Roger Wolter Program Manager.

Yukon Service BrokerYukon Service Broker

What is Service BrokerWhat is Service Broker

Why do asynchronous queued operations?Why do asynchronous queued operations?

Why are queued applications hard to write?Why are queued applications hard to write?

Why do messaging in the database?Why do messaging in the database?

ScenariosScenarios

Page 6: DAT325 SQL Server 2005 (Codenamed “Yukon”): Using the Service Broker To Build Asynchronous, Queued Database Applications Roger Wolter Program Manager.

Why Do Asynchronous Queued Operations?Why Do Asynchronous Queued Operations?

Loose couplingLoose coupling

PerformancePerformance

Load distributionLoad distribution

Batch processingBatch processing

Scale outScale out

Page 7: DAT325 SQL Server 2005 (Codenamed “Yukon”): Using the Service Broker To Build Asynchronous, Queued Database Applications Roger Wolter Program Manager.

Hello WorldHello WorldRoger WolterRoger WolterProgram ManagerProgram ManagerSQL ServerSQL Server

Page 8: DAT325 SQL Server 2005 (Codenamed “Yukon”): Using the Service Broker To Build Asynchronous, Queued Database Applications Roger Wolter Program Manager.

Yukon Service BrokerYukon Service Broker

What is Service BrokerWhat is Service Broker

Why do asynchronous queued operations?Why do asynchronous queued operations?

Why are queued applications hard to write?Why are queued applications hard to write?

Why do messaging in the database?Why do messaging in the database?

ScenariosScenarios

Page 9: DAT325 SQL Server 2005 (Codenamed “Yukon”): Using the Service Broker To Build Asynchronous, Queued Database Applications Roger Wolter Program Manager.

Why Are Queued Applications Hard To Write?Why Are Queued Applications Hard To Write?

Message IntegrityMessage Integrity

Message OrderingMessage Ordering

Multi-Reader QueuesMulti-Reader Queues

DistributionDistribution

Transactional MessagingTransactional Messaging

Queue Reader ManagementQueue Reader Management

Page 10: DAT325 SQL Server 2005 (Codenamed “Yukon”): Using the Service Broker To Build Asynchronous, Queued Database Applications Roger Wolter Program Manager.

Message IntegrityMessage Integrity

Asynchronous messages may be Asynchronous messages may be valuable business informationvaluable business information

““Message transport – not a database”Message transport – not a database”

Service Broker messages have all the Service Broker messages have all the reliability and high availability of SQL reliability and high availability of SQL ServerServer

Transaction logTransaction log

Database MirroringDatabase Mirroring

Page 11: DAT325 SQL Server 2005 (Codenamed “Yukon”): Using the Service Broker To Build Asynchronous, Queued Database Applications Roger Wolter Program Manager.

Why Are Queued Applications Hard To Write?Why Are Queued Applications Hard To Write?

Message IntegrityMessage Integrity

Message OrderingMessage Ordering

Multi-Reader QueuesMulti-Reader Queues

DistributionDistribution

Transactional MessagingTransactional Messaging

Queue Reader ManagementQueue Reader Management

Page 12: DAT325 SQL Server 2005 (Codenamed “Yukon”): Using the Service Broker To Build Asynchronous, Queued Database Applications Roger Wolter Program Manager.

Message OrderingMessage Ordering

Retries and routing affect message orderRetries and routing affect message order

Rollbacks can change processing orderRollbacks can change processing order

Order only reliable within a transactionOrder only reliable within a transaction

Writing applications resilient to processing Writing applications resilient to processing order changes can be difficultorder changes can be difficult

Service Broker dialogs ensure in order Service Broker dialogs ensure in order processingprocessing

Across transactionsAcross transactions

Across sending threadsAcross sending threads

Across receiving threadsAcross receiving threads

Page 13: DAT325 SQL Server 2005 (Codenamed “Yukon”): Using the Service Broker To Build Asynchronous, Queued Database Applications Roger Wolter Program Manager.

Why Are Queued Applications Hard To Write?Why Are Queued Applications Hard To Write?

Message IntegrityMessage Integrity

Message OrderingMessage Ordering

Multi-Reader QueuesMulti-Reader Queues

DistributionDistribution

Transactional MessagingTransactional Messaging

Queue Reader ManagementQueue Reader Management

Page 14: DAT325 SQL Server 2005 (Codenamed “Yukon”): Using the Service Broker To Build Asynchronous, Queued Database Applications Roger Wolter Program Manager.

Queuing At The Grocery StoreQueuing At The Grocery Store

Page 15: DAT325 SQL Server 2005 (Codenamed “Yukon”): Using the Service Broker To Build Asynchronous, Queued Database Applications Roger Wolter Program Manager.

Queuing At The AirportQueuing At The Airport

Page 16: DAT325 SQL Server 2005 (Codenamed “Yukon”): Using the Service Broker To Build Asynchronous, Queued Database Applications Roger Wolter Program Manager.

Why Are Queued Applications Hard To Write?Why Are Queued Applications Hard To Write?

Message IntegrityMessage Integrity

Message OrderingMessage Ordering

Multi-Reader QueuesMulti-Reader Queues

DistributionDistribution

Transactional MessagingTransactional Messaging

Queue Reader ManagementQueue Reader Management

Page 17: DAT325 SQL Server 2005 (Codenamed “Yukon”): Using the Service Broker To Build Asynchronous, Queued Database Applications Roger Wolter Program Manager.

Message TransportMessage Transport

Dialog ProtocolDialog ProtocolEnd-to-end protocolEnd-to-end protocol

Exactly once deliveryExactly once delivery

In order deliveryIn order delivery

Symmetric failureSymmetric failure

Authentication and encryptionAuthentication and encryption

Transport ProtocolTransport ProtocolEfficient binary message formatEfficient binary message format

TCP/IP basedTCP/IP based

Bi-directional, multiplexed, best-effortBi-directional, multiplexed, best-effort

A

B C

D

Page 18: DAT325 SQL Server 2005 (Codenamed “Yukon”): Using the Service Broker To Build Asynchronous, Queued Database Applications Roger Wolter Program Manager.

Why Are Queued Applications Hard To Write?Why Are Queued Applications Hard To Write?

Message IntegrityMessage Integrity

Message OrderingMessage Ordering

Multi-Reader QueuesMulti-Reader Queues

DistributionDistribution

Transactional MessagingTransactional Messaging

Queue Reader ManagementQueue Reader Management

Page 19: DAT325 SQL Server 2005 (Codenamed “Yukon”): Using the Service Broker To Build Asynchronous, Queued Database Applications Roger Wolter Program Manager.

Transactional SemanticsTransactional Semantics

SQL Broker

State-B Msg-2

State-B Msg-2

State-A Msg-1

X1Y1

Z1

ServiceInstance

Msg-2 Send!

State-A Msg-1 State

-A Msg-1

State-A Msg-1

State-B

X2 DB writeY2 DB write

Z2 DB write

One Atomic TransactionOne Atomic TransactionOne Atomic Transaction

Page 20: DAT325 SQL Server 2005 (Codenamed “Yukon”): Using the Service Broker To Build Asynchronous, Queued Database Applications Roger Wolter Program Manager.

Why Are Queued Applications Hard To Write?Why Are Queued Applications Hard To Write?

Message IntegrityMessage Integrity

Message OrderingMessage Ordering

Multi-Reader QueuesMulti-Reader Queues

DistributionDistribution

Transactional MessagingTransactional Messaging

Queue Reader ManagementQueue Reader Management

Page 21: DAT325 SQL Server 2005 (Codenamed “Yukon”): Using the Service Broker To Build Asynchronous, Queued Database Applications Roger Wolter Program Manager.

ActivationActivation

Page 22: DAT325 SQL Server 2005 (Codenamed “Yukon”): Using the Service Broker To Build Asynchronous, Queued Database Applications Roger Wolter Program Manager.

Yukon Service BrokerYukon Service Broker

What is Service BrokerWhat is Service Broker

Why do asynchronous queued operations?Why do asynchronous queued operations?

Why are queued applications hard to write?Why are queued applications hard to write?

Why do messaging in the database?Why do messaging in the database?

ScenariosScenarios

Page 23: DAT325 SQL Server 2005 (Codenamed “Yukon”): Using the Service Broker To Build Asynchronous, Queued Database Applications Roger Wolter Program Manager.

Why Do Messaging In The Database?Why Do Messaging In The Database?

Integrated API for Messages and DataIntegrated API for Messages and DataSingle connection for messaging and other database Single connection for messaging and other database operationsoperations

Transactional receives/sends from remote systemsTransactional receives/sends from remote systems

Integrated management, deployment, and operationsIntegrated management, deployment, and operationsBackup, restore, configuration, monitoring, securityBackup, restore, configuration, monitoring, security

Startup and shutdown start, recover and stop Service BrokerStartup and shutdown start, recover and stop Service Broker

Queued messages and application session state Queued messages and application session state may be queriedmay be queried

Trace Events for monitoring and debuggingTrace Events for monitoring and debugging

Messages have database integrity and recoverabilityMessages have database integrity and recoverability

Page 24: DAT325 SQL Server 2005 (Codenamed “Yukon”): Using the Service Broker To Build Asynchronous, Queued Database Applications Roger Wolter Program Manager.

Why Do Messaging In The Database?Why Do Messaging In The Database?

Performance advantages for database Performance advantages for database applicationsapplications

No two-phase commits No two-phase commits for transactional messagingfor transactional messaging

Single log write on commitSingle log write on commit

No process boundary crossing No process boundary crossing to external messaging softwareto external messaging software

Optimized “in-instance” deliveryOptimized “in-instance” delivery

Page 25: DAT325 SQL Server 2005 (Codenamed “Yukon”): Using the Service Broker To Build Asynchronous, Queued Database Applications Roger Wolter Program Manager.

Yukon Service BrokerYukon Service Broker

What is Service BrokerWhat is Service Broker

Why do asynchronous queued operations?Why do asynchronous queued operations?

Why are queued applications hard to write?Why are queued applications hard to write?

Why do messaging in the database?Why do messaging in the database?

ScenariosScenarios

Page 26: DAT325 SQL Server 2005 (Codenamed “Yukon”): Using the Service Broker To Build Asynchronous, Queued Database Applications Roger Wolter Program Manager.

ScenariosScenarios

Order entryOrder entry

Parallel stored procedureParallel stored procedure

PlanningPlanning

Page 27: DAT325 SQL Server 2005 (Codenamed “Yukon”): Using the Service Broker To Build Asynchronous, Queued Database Applications Roger Wolter Program Manager.
Page 28: DAT325 SQL Server 2005 (Codenamed “Yukon”): Using the Service Broker To Build Asynchronous, Queued Database Applications Roger Wolter Program Manager.
Page 29: DAT325 SQL Server 2005 (Codenamed “Yukon”): Using the Service Broker To Build Asynchronous, Queued Database Applications Roger Wolter Program Manager.
Page 30: DAT325 SQL Server 2005 (Codenamed “Yukon”): Using the Service Broker To Build Asynchronous, Queued Database Applications Roger Wolter Program Manager.

Event NotificationEvent NotificationRoger WolterRoger WolterProgram ManagerProgram ManagerSQL ServerSQL Server

Page 31: DAT325 SQL Server 2005 (Codenamed “Yukon”): Using the Service Broker To Build Asynchronous, Queued Database Applications Roger Wolter Program Manager.

Visit the SQL Server 2005 website: Visit the SQL Server 2005 website: www.microsoft.com/sql/2005www.microsoft.com/sql/2005

Learn more about SQL Server 2005 at TechLearn more about SQL Server 2005 at TechEdEd Hands On Labs Hands On Labs

Rooms 6E and 6FRooms 6E and 6F 13 Hands On Labs13 Hands On Labs

Ask the Experts Ask the Experts Track Cabanas located around CommNetTrack Cabanas located around CommNet Experts Available All WeekExperts Available All Week

Next Steps: SQL Server 2005Next Steps: SQL Server 2005

Exclusive TechExclusive TechEd Offer!Ed Offer!Receive Receive Beta 2Beta 2 of of SQL Server 2005SQL Server 2005

Register for SQL Server 2005 Beta 2 at: Register for SQL Server 2005 Beta 2 at: http://www.msteched.com/SqlBetaBits.aspx

Exclusive TechExclusive TechEd Offer!Ed Offer!Receive Receive Beta 2Beta 2 of of SQL Server 2005SQL Server 2005

Register for SQL Server 2005 Beta 2 at: Register for SQL Server 2005 Beta 2 at: http://www.msteched.com/SqlBetaBits.aspx

Page 32: DAT325 SQL Server 2005 (Codenamed “Yukon”): Using the Service Broker To Build Asynchronous, Queued Database Applications Roger Wolter Program Manager.

SQL Server 2005: SQL Server 2005: More SessionsMore Sessions

DAT330DAT330 Tue 3.30 – 4.45Tue 3.30 – 4.45 SQL Server 2005 (code named "Yukon"): Security EnhancementsSQL Server 2005 (code named "Yukon"): Security Enhancements

DAT329DAT329 Tue 5.00 – 6.15Tue 5.00 – 6.15 SQL Server 2005 (code named "Yukon"): A Platform for Web ServicesSQL Server 2005 (code named "Yukon"): A Platform for Web Services

DAT313DAT313 Wed 8.30 – 9.45Wed 8.30 – 9.45 Introducing SQL Server 2005 (code named "Yukon") Data Transformation ServicesIntroducing SQL Server 2005 (code named "Yukon") Data Transformation Services

DAT377DAT377 Wed 10.15 – 11.45Wed 10.15 – 11.45 Data mining in SQL Server 2000 and SQL Server 2005 (code named "Yukon")Data mining in SQL Server 2000 and SQL Server 2005 (code named "Yukon")

DAT317DAT317 Wed 2.00 – 3.15Wed 2.00 – 3.15 SQL Server 2005 (code named "Yukon"): Setup and DeploymentSQL Server 2005 (code named "Yukon"): Setup and Deployment

DAT318DAT318 Wed 3.45 – 5.00Wed 3.45 – 5.00 SQL Server 2005 (code named "Yukon"): .NET Framework-Based Programming in SQL Server 2005 (code named "Yukon"): .NET Framework-Based Programming in the Databasethe Database

DAT323DAT323 Wed 5.30 – 6.45Wed 5.30 – 6.45 SQL Server 2005 (code named "Yukon"): What's New in ReplicationSQL Server 2005 (code named "Yukon"): What's New in Replication

DAT328DAT328 Thu 8.30 – 9.45Thu 8.30 – 9.45 SQL Server 2005 (code named "Yukon"): Introduction to the Unified Dimensional SQL Server 2005 (code named "Yukon"): Introduction to the Unified Dimensional Model in Analysis ServicesModel in Analysis Services

DATC15DATC15 Thu 10.15 – 11.30Thu 10.15 – 11.30 Real Time Analytics: Bringing It All Together Using Analysis ServicesReal Time Analytics: Bringing It All Together Using Analysis Services

DAT321DAT321 Thu 10.15 – 11.30Thu 10.15 – 11.30 SQL Server 2005 (code named "Yukon"): Management ToolsSQL Server 2005 (code named "Yukon"): Management Tools

DAT319DAT319 Thu 1.30 – 2.45Thu 1.30 – 2.45 XML in the Database - the XML Data Type in SQL Server 2005 (code named "Yukon")XML in the Database - the XML Data Type in SQL Server 2005 (code named "Yukon")

DAT340DAT340 Thu 3.15 – 4.30Thu 3.15 – 4.30 Applying and Targeting DTS in SQL Server 2005 (Code Named "Yukon")Applying and Targeting DTS in SQL Server 2005 (Code Named "Yukon")

DAT324DAT324 Thu 5.00 – 6.15Thu 5.00 – 6.15 SQL Server 2005 (code named "Yukon"): Backup and Restore EngineSQL Server 2005 (code named "Yukon"): Backup and Restore Engine

DAT322DAT322 Fri 9.00 – 10.15Fri 9.00 – 10.15 SQL Server 2005 (code named "Yukon"): SQL Server Management Object (SMO), SQL Server 2005 (code named "Yukon"): SQL Server Management Object (SMO), Next Generation SQL-DMONext Generation SQL-DMO

DAT431DAT431 Fri 10.45 – 12.00Fri 10.45 – 12.00 High Availability Technologies in SQL Server 2000 and SQL Server 2005 (code High Availability Technologies in SQL Server 2000 and SQL Server 2005 (code named "Yukon"): A Comparative Studynamed "Yukon"): A Comparative Study

DAT326DAT326 Fri 10.45 – 12.00Fri 10.45 – 12.00 SQL Server 2005 (code named "Yukon"): Be More Efficient with T-SQLSQL Server 2005 (code named "Yukon"): Be More Efficient with T-SQL

DAT325DAT325 Fri 1.00 – 2.15Fri 1.00 – 2.15 SQL Server 2005 (code named "Yukon"): Using the Service Broker to Build SQL Server 2005 (code named "Yukon"): Using the Service Broker to Build Asynchronous, Queued Database ApplicationsAsynchronous, Queued Database Applications

DAT327DAT327 Fri 2.45 – 4.00Fri 2.45 – 4.00 SQL Server 2005 (code named "Yukon"): Inside XQuerySQL Server 2005 (code named "Yukon"): Inside XQuery

Page 33: DAT325 SQL Server 2005 (Codenamed “Yukon”): Using the Service Broker To Build Asynchronous, Queued Database Applications Roger Wolter Program Manager.

SQL Server Community sitesSQL Server Community siteshttp://www.microsoft.com/http://www.microsoft.com/sql/community/default.mspxsql/community/default.mspx

List of newsgroupsList of newsgroupshttp://www.microsoft.com/sql/community/newsgroups/default.mspxhttp://www.microsoft.com/sql/community/newsgroups/default.mspx

Locate Local User GroupsLocate Local User Groupshttphttp://www.microsoft.com/communities/://www.microsoft.com/communities/usergroups/default.mspxusergroups/default.mspx

Attend a free chat or web castAttend a free chat or web casthttp://www.microsoft.com/communities/chats/default.mspxhttp://www.microsoft.com/communities/chats/default.mspx http://www.microsoft.com/usa/webcasts/default.asphttp://www.microsoft.com/usa/webcasts/default.asp

Page 34: DAT325 SQL Server 2005 (Codenamed “Yukon”): Using the Service Broker To Build Asynchronous, Queued Database Applications Roger Wolter Program Manager.

Q1:Q1: Overall satisfaction with the sessionOverall satisfaction with the session

Q2:Q2: Usefulness of the informationUsefulness of the information

Q3:Q3: Presenter’s knowledge of the subjectPresenter’s knowledge of the subject

Q4:Q4: Presenter’s presentation skillsPresenter’s presentation skills

Q5:Q5: Effectiveness of the presentationEffectiveness of the presentation

(9 is the correct answer)(9 is the correct answer)

Please fill out a session evaluation on CommNetPlease fill out a session evaluation on CommNet

Page 35: DAT325 SQL Server 2005 (Codenamed “Yukon”): Using the Service Broker To Build Asynchronous, Queued Database Applications Roger Wolter Program Manager.

© 2004 Microsoft Corporation. All rights reserved.This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.