MOM vs RPC

 


This blog will discuss about MOM (Message-oriented-middleware) and RPC (remote-procedure-call) which are infrastructure allowing communication and exchanges the data/messages. But they have some clearly differences of the way that they do

MOM (Message-oriented-middleware)

In order to understand MOM, first we need to know "what is a middleware". Middleware is a software acts like a link between applications, data and users. It helps developer can build and deploy applications more efficiently. Because for organizations with multi-cloud, middleware can make it cost-effective to develop and run applications at scale. For example when we use SSO authentication, this also is an authentication middleware among services.

MOM acts like a middleware for different applications. MOM architecture provides asynchronous communication between systems this means it don't need to be available at the same time because the communicate by sending and receiving message from message queues. 

Message queue helps in storing the message and it acts as a central component. Because applications communicate with each other by interacting with message queues so they don't interact with each other directly. This is a reason that MOM likes a central component. Message queue adheres FIFO (First In First Out), it means the First message is sent to message queue, it also is the First message is received from message queue.

Advantages:

- Loose coupling: because of message queue, MOM acts as a central player among applications so we don't need to adjust provider system or consumer system.

- Reliability: Receiver can be prevented lost messages because network is down, trouble or the system is busy, unavailable. Based on saving messages persistently (message persistency), Receiver don't need to be available or keep alive when messages are sent. Or messages can be sent more than 1 time.

- Scalability: systems use MOM that are not or a little mutual influences when one of them has a trouble. Besides, it support priority/load-balancing by allowing retrieval of message off the queues in any order

- Availability: MOM support systems that are always available and handle their process smoothly or handle their trouble quickly to prevent influences from any systems use MOM has trouble because of loose coupling.

RPC (Remote-Procedure-Call)

RPC provides synchronous between systems. It used to call other processed on the remote system like a local system. RPC use client-server model. The requesting program is a client and the service-providing program is a server. 

When systems use RPC that means the client will be blocked while waiting for another requesting before.

RPC and Rest that are similar, so why we need use both of them instead of using one? 

That because Rest used to implement create, read, update, delete (CRUD) operations on a database object on a server. But RPC used to call remote function on server that require an action result or you require complex calculations, trigger a remote procedure on the server with the process hidden on the client. It makes this difference is the structure, implementation and underlaying principles differ. Systems are designed with Rest known as RESTful APIs, whereas systems designed with RPC are RPC APIs. So in some cases RPC is better that Rest and other else.

Advantages:

- It support the process hidden on the client.

- It improves performance because reduce some protocol layers.

- It helps client communicate with server by the conventional use of procedure calls in high-level languages.

- RPC allows the usage of applications in a distributed environment that not only in a local environment

Differences between MOM and RPC




 

Post a Comment

Comment

Previous Post Next Post
WANG !!!!!
https://s.shopee.vn/609U3II1Xf