What is Service Broker in SQL Server?

Nasser Hadjloo picture Nasser Hadjloo · May 18, 2010 · Viewed 21.3k times · Source

What is Service Broker in SQL Server and is it meaningful to enable it in a simple database, not in a distributed database?

Answer

Nix picture Nix · May 18, 2010

SQL Service Broker is an extension mechanism that allows you to queue events for asynchronous processing.

There is no intrinsic harm in enabling the broker. If it's not used, it will just be idle.

It works in both simple and distributed DBs. A simple use case would be a logging queue. We used it at a client to queue XML messages to be processed asynchronously. So we push an XML to an InitatorQueue, and then had a service pull them from the queue, extract some necessary attributes via XPath, and insert them into a persistence table in our database.

Here is a good reference from Microsoft.