Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why would you use a message based system?

What are the motivations for using a message based system?

I'm seeing a lot about service buses such as NServiceBus and Mass Transit and I'm wondering what the benefits of the underlying methodology are.

like image 643
Garry Shutler Avatar asked Dec 17 '08 12:12

Garry Shutler


People also ask

What is message-based system?

A systems-based approach uses a standardized set of management steps that are sequential and may be applied to any major undertaking. This dictates that overarching objectives, strategies, and tactics are established to promote effective response management and consistency.

When should I use a message broker?

For example, a message broker may be used to manage a workload queue or message queue for multiple receivers, providing reliable storage, guaranteed message delivery and perhaps transaction management.

What are 3 types of messaging systems?

There are three types of messages: Nominal, Expressive and Predicative.

What is message-based communication?

Message-based asynchronous communication with a single receiver means there's point-to-point communication that delivers a message to exactly one of the consumers that's reading from the channel, and that the message is processed just once.


2 Answers

There are multiple advantages to using message based systems.

  1. Messages form a well defined technology neutral interface between applications.
  2. Enables loose coupling of applications.
  3. Lots of options for performance, tuning and scaling:
    • Deploy requester and service process on different hardware
    • Multiple requesters sharing single server
    • Multiple requesters sharing multiple servers
  4. The various messaging middlewares implement the common messaging patterns independently from you application.
    • Request/Reply
    • Fire and Forget offline updates
    • Publish/Subscribe
  5. Many of the middleware products handle message transformation (e.g. SWIFT to SWIFTXML).
  6. Many of the middleware products can decompose a single large request into several smaller requests.
  7. They nearly all support multiple platforms.

Incidentally the two market leaders in this area are IBM with their Websphere MQ and related products, and, TIBCO with their Enterprise Service Bus.

like image 67
James Anderson Avatar answered Sep 24 '22 22:09

James Anderson


A message-based architecture de-couples producers and consumers of messages, both in time and space. This has a lot of benefits:

  • producers and consumers can run on different machines
  • producers and consumers can run at different times.
  • producers and consumers can run on different hardware/software platforms (they only need to understand the same message protocol)
  • it's easy to coordinate multiple producers / consumers (e.g. for compute-intensive jobs that need multiple machines, as Dave Markle has described)
  • higher stability when services are temporarily unavailble (e.g. when doing order processing, using a messaging system can help avoid "dropping" orders)

You lose most of these benefits when you do RPC-style communication (i.e. when you block while waiting for service responses)

like image 26
mfx Avatar answered Sep 24 '22 22:09

mfx