The purpose/s of this question is to discover what are some of the most reliable methods of achieving communication between existing offline software and a web application.
(Example) Scenario:
A person has written a piece of software that primarily runs “offline” on a cluster/network of local servers (accessible physically).
This piece of software is a structural mapping of the highway system and was written in a language like C++ over many years and has been well maintained.
Now, this person wants to build a web application (in a language like Ruby/Python) that is attempting to take traffic-flow data via a government API and wants to:
- Take this data and load it into to the offline software
- Use the offline software to map out better traffic flows (and other statistical analyses)
- Send this data back to the web application to be communicated via HTML5/Javascript to a client/s
Some points to be held constant:
- This is the system the client has specified and the only way
- Both the offline system and the web application will be using SQL for their databases
- The person has invested a large number of hours and maintenance that do not warrant a rewrite of the offline software
Based on the above, what are some options for achieving this?
Can this be achieved on an application and/or database layer?
Which layer would provide a structure where neither application has to be modified to function with the other application? (separation of concerns)
What is the most common (known) method for achieving such communication?
4
I’ve been successful using JSON for communicating between online applications and workstation software.
A possible workflow would be as follows:
- Admit input via a web application (e.g., forms, REST-API, text message, what have you)
- Emit a “job” id in response to the input
- Codify the input as a JSON document
- Pass the JSON document to a batch-processing application capable of reading the JSON file and running the workstation application with those inputs
- The workstation application stores the results either as a JSON file which can be immediately displayed on the website, or (better), stored in a database which can then be queried by the web application.
- Mark the “job id” as done.
The user can now use the job id to retrieve the results. If the whole thing is very rapid you may do it all on-line and dispose of the job id.
Just as suggestion… it has worked for me.
1