I want to make connection between two parts of my program which can be located in departed places.
I have some choices for making this connection:
- using PRC/RMI: in every request a calling method will send to second part
- using normal function call
- using queue(in memory):every request will be placed in a queue and second part will get that and answer requests
- using queue(in DB):like number 3 but in DB
- using socket for sending data(TCP/IP or UDP or …)
- using web service
can anyone compare these available ways?
Here are my thoughts:
Synchronous calls mean the caller and callee are directly coupled. The interface has to be kept constant.
Asynchronous calls mean looser coupling between the caller and callee. Like the synchronous case, the messages have to be relatively stable.
UPDATE: The picture you added makes the problem murkier. The interaction with 3rd party merchant and card handlers makes your error situation dicier. What happens if one of those fails? What if either one is unavailable? If the bank fails, how do you communicate that back to the 3rd parties? Very complicated, indeed. You’ll have bigger problems than just choosing between RMI and web services.