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

3

107

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".

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

Chuddar answered 27/4, 2010 at 20:25 Comment(5)
I'm really late to the party, i won't post this as answer because its not as such but in short, if you don't know why you need one then chances are you don't ... it solves a specific problem that you likely don't have around connecting applications and giving your business a centralised API.Sedan
@Wardy I would disagree with your statement. The fact that you don't understand something or don't know what it is, does not mean it wouldn't help you to know about itVariform
That wasn't an excuse for ignorance but more pointing out that service bus is a term thrown around a lot when you hit the sort of problem it solves so you'll either need it or you won't and thus never have to worry about it.Sedan
I'd add this as an edit but it would fundamentally change the question... NServiceBus is now known as "Particular Service Platform" and can be found at particular.net (which is where NServiceBus.com redirects to now anyway).Pentlandite
If you don't know the name or concept of a thing that already exists one is likely to write their own. Therefore it's good to know about them so you can use them (if you need to)Super
J
84

You can think of a service bus as the Ethernet of SOA (Service Oriented Architecture).

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.

Jadajadd answered 28/4, 2010 at 5:28 Comment(0)
C
14

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

Cullender answered 27/4, 2010 at 20:27 Comment(2)
So I can use it to do the communication between a desktop client application and a server? Where the server is inhouse, that is.Chuddar
You could. You could also use it for communication between different services, different versions of different services, etc. (including situations where the services use different protocols).Cullender
A
14

This term was introduced with SOA which is in a way the successor (as buzz word) of EAI.

When you need it? That's a good question. It comes with a lot of complexity.

A rule of thumb could by if it solves more problems than it causes.

To be serious if you have a heterogeneous environment and want align (different) applications (using different technology) with business processes. Then it could be helpful to use BPEL (but this introduces problems by migration) for orchestration and choreography

EDIT: What's not on wikipedia, is practice: An ESB can i.g. adapt using special connectors, old terminal applications for use with Corba or Java Enterprise thats meant by interoperability. The drawback is the over 100 'Standards' around SOAP wich don't cooperate without enormous effort.

You definitely need it if you have to interconnect IT systems within six month after a merger of 2 big assurance companies.

Ayana answered 27/4, 2010 at 20:58 Comment(3)
So - in my desktop application which has a "simple" communication with a server side there is no need to go large with a Service Bus? Can it help me implement a push model from the server? Or will it be more pain than gain in this scenario too?Chuddar
@Chuddar sorry I read (Enterprise) service bus and synapses fired. I checked your link to NServiceBus they target the same, you don't need something like that in a client server app. It's meant by concept for multiple applications involved in one business process. If it would work for you? If it solves more problems than it causes.Ayana
Use it "if it solves more problems than it causes" ... love it.Super

© 2022 - 2024 — McMap. All rights reserved.