ARTICLE AD BOX
You can use TCP sockets to communicate quite reliably between processes running on different machines in the same local network.
Some more information on using sockets in .NET environment (which WinForms suggests):
Use Sockets to send and receive data over TCP.
It is good but I need to deal with firewalls and also to manage lost data when the destination PC is off. I need something that can be more trustable and also the operator in destination may not approve or reject the transfer request at the same day
Is the server actually serving API (etc.) requests from the WinForm clients?
If it isn't – ie. you're doing traditional client/server – then you'll end up needing polling (doesn't scale) of the database plus one tenant accessing another tenant's database or you need to introduce a server running logic. Essentially when tenant A wants some of SKU 1 from tenant B, that needs an entry in both tenant's databases so each can track their side of the transfer. You need to work out this side of things before even considering how to get notifications to users.
If you have an application server then things are much easier:
Make use of message queues to communicate between the server acting for one tenant, and its acting for another (in the future you'll be in a position to support multiple servers and scale out). When processing an inbound message something like SignalR can be used to alert users.The kind of messaging patterns that are apply are those used for inter-bank transfers. These explicitly are there to deal with all the possible failure cases (from lack of product, to declining the transfer, to systems being unavailable).
There is not nearly enough information here to give good advice.
Starting with the planned overall network architecture, over the separation of the different entities ("company"s ...) in the database(s ?) to your definitions of "real time" and "good".
If the applications follow the typical database-applicationserver-client architecture it is probably easiest to just let the application servers talk directly to each other using whatever protocol they are already using.
If you don't have an application server I would suggest using a message broker. This is a piece of software installed on the server that will just transfer messages between the applications according to the rules you configure. This should typically also allow for persistent queues in case some application is offline. Some popular brokers are Mosquitto, RabbitMQ, and HiveMQ.
I would not recommend using raw TCP or designing your own low level protocol. Nor would I recommend using a database to pass messages.
You need a "staging area"; or staging database; that is neither "A" or "B". You have a transaction that needs to "credit" inventory and "debit" the recipient; once the transaction is "approved" (and "posted"). At which time, stock could have been depleted (for whatever reason) before the transaction is approved (necessitating a roll-back versus a commit).
*) Option 1 API (best method). *) Option 2 Common Database like server client.
Explore related questions
See similar questions with these tags.
