Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Service oriented architecture - Transport layer (http vs messaging)

We've looking at moving splitting up our architecture (and adding new components) using a Service Oriented Architecture (SOA). There will be a number of external API's that will be used by third parties, which we will make using a REST HTTP interface, however I was wondering what would be best to use internally as all components are with in our control and will be on the same network, however potentially different technologies (mainly .net and ruby on rails).

Would there be big performance/functionality gains in using a messaging system (redis, rabbitmq, EMS, other notable exceptions I've not heard of...) instead of HTTP (REST, SOAP, etc).

I've struggled to find good information on this topic and (as you can probably tell) I'm fairly new to this side area, so any advice or good resources would be appreciated!

Thnaks

like image 573
Ben Avatar asked Dec 13 '12 16:12

Ben


People also ask

What are the 3 types of architecture in SOA?

There are three roles in each of the Service-Oriented Architecture building blocks: service provider; service broker, service registry, service repository; and service requester/consumer.

What is Service-Oriented Architecture and how does IT differ from web services?

SOA vs Web Services Web services are used to build applications that can send/receive messages using SOAP over HTTP. A web service is a publicized package of functionality offered over the web. SOA is a set of architectural concepts used for the development and integration of services.

What is Service-Oriented Architecture and how does IT relate to web services?

SOA is an architectural style for building software applications that use services available in a network such as the web. It promotes loose coupling between software components so that they can be reused. Applications in SOA are built based on services.

What is the difference between SOA Service-Oriented Architecture and cloud computing?

While SOA is a flexible set of design principles used during the phases of systems development and integration that when deployed, will provide a loosely-integrated suite of services that can be used within multiple business domains, a cloud-based service is an internet-based computing solution where resources, ...


2 Answers

Messaging tends to give you a more loosely coupled architecture. It can potentially be more robust as well, since individual components can fail without killing the entire infrastructure.

The downside is complexity, the paradigm shift to an asynchronous model, and possibly performance (especially if you're persisting messages every where).

You also need to ensure that your messaging system is particularly robust. A single aspect of your logic can go down and restart without affecting everything, but if you lose your core message base, then ALL of your logic is down waiting for the messaging to be back up.

Fortunately, the message bus can be long running without humans fiddling and touching it, the largest source of errors and instability in any system.

like image 137
Will Hartung Avatar answered Sep 22 '22 01:09

Will Hartung


In addition to what @Will Hartung mentioned, I would also say that it depends on what you are going to do with your system. If you have mostly client-server type applications, where you have few servers/services and they tend to be completely independent, then it will probably be easier to implement service contracts via REST over HTTP.

If, on the other hand, your entire system is doing bi-directional communication, or if there are many inter-process calls (and particularly if every participant in the system is going to be both a client and a server at some point), then messaging is your best bet. Of the messaging options, I find that AMQP/RabbitMQ is the most feature-rich and easy to use of all of these. It offers you a true asynchronous platform to code against.

They key benefit to using messaging is that you can have queues for each type of message, so as your system expands and changes, the queues/messages can be the same, but the service that handles them can change underneath. It promotes separation of layers.

Finally, and this is a huge thing in my opinion, the proper use of messaging promotes small, independent pieces of code. These are both more testable and more maintainable, and in general it simplifies your enterprise architecture. If you attempt to handle too many services from HTTP endpoints, you will eventually (over the course of a year or two) end up with either (1) way too many endpoints to keep track of or (2) an unmaintainable mess of spaghetti code.

My company started out with using a message-based framework, and it has worked very well for us. The RabbitMQ server has easily been the most reliable component. Feel free to ask if you have any more questions about messaging or SOA.

like image 45
theMayer Avatar answered Sep 22 '22 01:09

theMayer