Monday, 4 February 2019

What is the best way to message pass between different processes and maintain request/response pairing?

I want to build an app that has 3 different running processes.An HTTP serverA process to interact with the databaseA process to send Apple Push NotificationsI’ve already written an app which combines all of this functionality, but I thought it would be interesting to separate the main parts into their own processes.I think it will be something interesting to learn, as well as allow me to set up multiple Docker containers that must rely on and interact with one another - is this when cluster management comes into play, like Kubernetes? - I think so, which was another interest in this design.For the designMy initial thoughts were to have the HTTP server run a NET client which interacts with independent NET servers running within the process interacting with the database and the process to send APNs, respectively. If I don’t care about the HTTP server process receiving a status response for APNs, I think that should be pretty straight forward, I can just send the data in a single message that can be turned into an Object and handled from there. But, I’m thinking I might run into issues with the HTTP Server <—-> Process interacting with the database communications, as I’ll need to receiving the responses as well, which I assume won’t always be in order.If everything is being sent back and forth on the same connection, I need to find a way to order requests and responses so that they are always matched up properly, as I believe a large request sent before a small request may get its response after the smaller one. I keep thinking that I could maintain some sort of numbering system so that each request is matched up with a unique ID that is also returned on the response, but I feel like this is a problem that has already been solved before.🤷‍♂️, just thinking out loud.Thanks for your time and thoughts.

Submitted February 05, 2019 at 02:35AM by ELIPhive

No comments:

Post a Comment