What is a servicebus and when do I need one?

stiank81 picture stiank81 · Apr 27, 2010 · Viewed 35.4k times · Source

I have heard talk about the NServiceBus, but I haven't really understood what it is. They claim to be "The most popular open-source service bus for .net".

So; what is a "service bus", and when do I need one?

Answer

Udi Dahan picture Udi Dahan · Apr 28, 2010

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.