Saturday, July 05, 2008

Book Review: Pro SQL Server 2005 Service Broker

As I mentioned earlier, I've been working a lot lately with the Service Broker in Microsoft SQL Server. I'm planning a couple posts this month detailing tips and "gotchas," but thought I'd start with a review of Klaus Aschenbrenner's book on the subject.

Microsoft's documentation for Service Broker is pretty thin, and sorely lacks for guidance in best practices. I supplemented with two sources: Remus Rusanu's excellent blog and Klaus Aschenbrenner's book Pro SQL Server 2005 Service Broker. Frankly, I think you need the information from them both to build a well-designed Service Broker application.

Klaus does a terrific job of laying out the overall architecture for Service Broker. He explains (in good detail) the portions that aren't very intuitive and builds on the knowledge as he goes. The first half of the book is very "how to" and grounds you very well in the details of building an app. The latter half of the book leans more toward the architectural side, showing how Service Broker fits into SODA, high availability, and distributed transactions.

One bit that I wish Klaus made clearer is his section on performance in Chapter 6. He builds a nice series of tests using different dequeue approaches and message formats. What wasn't clear (at least to me) in the first read through was that the performance benefits were also reliant on the use of shared conversation dialog handles. I had originally been working with a single-message-per-conversation approach, which entirely changed the performance characteristics.

Anyone who's read Tom Kyte's books and posts is indoctrinated into the idea that performance should always be tested locally, with our own configuration scenarios. My tests showed essentially no performance gains from Chapter 6's recommendations until I switched how my dialog handles were managed -- the subject of next week's post.

Overall, I highly recommend Klaus's book if you're going to build a production-quality app that relies on Service Broker. It saved me hours -- nah, make that days -- and helped me flat-out avoid issues I hadn't even thought to consider.

0 comments: