DaveWentzel.com            All Things Data

Service Broker Demystified

Service Broker Demystified Series - Summary

This blog series focused on the common complaints I hear about SQL Server Service Broker...namely that it is too confusing for a data professional to master.  The fact that there is no (good) GUI or monitoring tools doesn't help either.  In this series I simplified things and explained why SSB works the way it does.  I also provided tricks and shortcuts to make everything a little simpler.  SSB is a really great technology and I find new uses for it almost every day.  

Service Broker Demystified - How to Radically Simplify SB

Setting up Service Broker objects can be challenging.  Objects need to be deployed in the correct dependency order.  And then if something goes wrong you need to determine what objects need to be recreated as well as what messages may still be "stalled" and waiting for processing.  In this post I'll show you my "pattern" script that helps to ease these burdens.  Using the concept of "script idempotency" I can guarantee that all objects are deployed and running correctly.  At any time.  

Service Broker Demystified - Monitoring the Canaries

Service Broker doesn't have a native series of monitoring scripts nor a GUI to show you the health of your queues.  In this post I'll show you what I monitor and why.  I even have some interesting "canaries" that I monitor that will tell me when my SSB design is nearing an imminent failure.

Service Broker Demystified - Can I model monologs? Yes you can!

The most common use case for Service Broker is to run a stored procedure asynchronously.  This is best modeled as a monolog, commonly known in the SQL Server world as "fire-and-forget".  Every other messaging system (MSMQ, JMS, Rabbit MQ) support monologs natively, in fact they are the default.  But not Service Broker.  If you try to model a monolog you'll find that it is rife with danger.  In this post I'll show you how you can, safely, model a monolog.  

Service Broker Demystified - Fire and Forget Anti-Pattern

After you work with Service Broker for some time you'll learn about the dreaded "fire-and-forget" (anti-)pattern.  In this post I'll show you exactly why fire-and-forget is so bad.  I'll also show you the one simple rule to remember to avoid accidentally modeling fire-and-forget. Finally, we'll learn how to fix it production systems where fire-and-forget has bitten you.  In the next post we'll cover how to model a real fire-and-forget design safely...using a monolog.  

Service Broker Demystified - Must my SQL Server be wired to the internet?

Service Broker uses a lot of syntax that is unfamiliar to data professionals.  This scares them away from using SSB.  For instance, DBAs will see references to URLs like http://schemas.microsoft.com/SQL/Notifications/PostQueryNotification and immediately assume that their SQL Server will need to be wired to the internet to resolve those references.  It doesn't.  Those are simple URIs (namespaces) and SSB never connects to them.  In this post I'll prove it and show you why they are used.  

Service Broker Demystified - CLOSED conversations

Those new to Service Broker are confused by CLOSED conversations.  They hang around even when they are CLOSED.  A quick google search will tell you this is for security purposes.  In this post I'll show you exactly why that is.  Also, invariably, one day a DBA will see a huge number of CLOSED conversations that never get cleaned out.  I'll also cover why that happens and how to avoid it.  

Service Broker Demystified - Case-Sensitivity

Some SSB objects are case-sensitive, but which ones?  Shouldn't they all follow the case sensitivity of your server or database?  The answer:  No.  Only "exposed" SSB objects are case-sensitive.  This post will cover why.  

Service Broker Demystified - [Initiators] and 'Targets'

Service Broker "initiators" adhere to the rules for object identifiers.  But "target" service objects are simple string literals.  This leads to goofy syntax and confusion.  This is really no big deal and in this post I'll cover in detail why it works this way.  

Service Broker Demystified - Services

Services and the [DEFAULT] contract can be very confusing.  In the post I'll show you why that is and some simple ways to resolve the problems in your mind.  Then we'll look at how to model send-only and receive-only services, which is another constraint you can use in your SSB design. 


Subscribe to RSS - Service Broker Demystified