I want to split up the following workflow of a C++ program:
Read serialized data (1 sec, which is already very fast for that size)
Search data (0.01 ms)
Return found data(0.00.. ms) Edit: found data is just a small file
Obviously reading the data takes most of the time. Additionally, the data that is being read, never changes. To speed up the workflow, I want to read the data once, then wait for requests. Just like a MySQL db, that is waiting for statements. Or any other Process that is running and just waiting for something to do. Right now, I start the program using the shell, and it will only be run inside a linux docker container.
What would be your approach to do that?
Goal: The program is always running and waiting for search metadata from another process (bash script?, a nodejs exec call), then perform search, then return data (write to file)
Dependency: I want to build this without eg nodejs v8 integration
Is Boost Asio a good startingpoint? Do I need to build a socket server? Are there easier ways?