What is a service bus and when do I need one?

Solution 1:

You can think of a service bus as the Ethernet of SOA.

First and foremost, it introduces a language of identifying things, like an IP address in Ethernet. This name isn't something inherently physical.

Next, you have something physical involved on each node, like a queue in the case of a bus for supporting semi-connected communication, or an Ethernet card in the metaphor.

Beyond just the physical, there is the "protocol" part of the communication, like the OSI stack for Ethernet. With the bus, this is the client libraries used by application code.

Ultimately, you can view a service bus as providing the next higher level of abstraction for building distributed systems. You can use it also for client-server communication to give you durable one-way messaging as well as for the server to push notifications back to the client.

Specifically, you'll find NServiceBus to be quite lightweight and easy to use once you make peace with its use of queuing technology - your choice of RabbitMQ, MSMQ, Regular SQL Tables, Amazon SQS, Azure Storage Queues, and Azure Service Bus.

Solution 2:

Check out the Wikipedia article for Enterprise Service Bus.

A Service Bus acts as yet another layer of abstraction in the never ending quest to implement a good Service Oriented Architecture. The Service Bus can handle some of the heavy lifting seen behind a good Service Oriented Architecture like Messaging, Routing, and Service Co-Ordination.

If you're not sure why you'd want anything like that, I'd suggest reading up on what makes a good Service Oriented Architecture. The book that really opened my eyes and proved the different between just having Web Services and having a true Service Oriented Architecture was Thomas Erl's Service-Oriented Architecture: Concepts, Technology, and Design