Hi fellow lemmings,
currently, I am working on a small project, where I am in need of some help. My project consists of multiple services, that depend on each other. The stack consists of front-end, middle-tier & back-end/database. To get a detailed answer, I try to formulate my question thoroughly.
On top of the stack are running two services. Both of them need to access the DB via a middle-tier.
One service will offer the web interface & the REST API for automated services. It will be hosted by a python web service. The skeleton for this part is mainly done. The service needs to communicate with the middle tier to manage user actions.
A second service of the front-end will manage the executing part of the service and interacts with the internet. It will be written in python as well. The service needs to communicate with the middle tier to get the instructions it’s supposed to execute.
The middle tier will act as a interface between the front-end services & the database. I’d like to implement it in C. The service is supposed to receive input from the front-end services, process it and access the database. Further features are planned but not necessary for the first release.
The back-end will be the database system. It should only be accessed by the middle tier (preferably with a connection pool).
As far as I planned the project, I intend to run the front-end and the middle tier services on the same machine.
Well, if you read everything until here, you are probably willing to help. I am done with the skeleton for the front-ends, I am done with the table structure for the back-end. Also, the communication from the middle-tier to the database won’t be a problem. But I am struggling a bit with the communication between the front-end services and the middle-tier. What is common practice to communicate between a C service and Python services?
My ideas is to make use of common network approaches. For instance, could I host a REST service on the middle tier as well. This raises some fears, because I think this will be the bottle neck in terms of performance. Can you confirm? Alternatively, I was thinking of other IPC features like Unix Message Queues or system sockets. The latter one seems to be my favorite solution.
Unfortunately, I don’t have too much experience with inter process communication and would like to ask for your advice. How would you solve my problem?
Thank you very much for an answer.
A general programming discussion community.
Other programming communities: