I am creating a tool (a C# Windows form) to integrate data between different systems.
The tool triggers generation of an XML file (generated by PL/SQL on the Oracle database). It then stores it in an XMLType field of the database table. I want to then extract this file from the DB and upload it to a server.
The XML file could be up to 50MB in size and contain potentially sensitive personal data.
The tool app will run on hosts remote from both database server and destination (upload) server. It will allow the user to choose different types of XML data to produce, and different destination servers to upload to.
It would also be theoretically possible to upload the file directly from the database server directly to the destination. Thus, I could create the tool to simply co-ordinate this, without transferring the file to the host that runs the tool. Having said that, I imagine I would still have to write the file to the file-system of the database server, before uploading it. This just shifts the file write-out to the DB server filesystem, from the host running the tool.
In a nutshell: File X is generated by database server A, and needs to be transferred to server B for processing. The tool will co-ordinate both the generation and file transfer of X, from A to B.
So, the tool will:
- Trigger the Oracle database process to generate some XML via stored DB procedures. (This XML generation process is already working on Oracle)
- Extract the newly generated XML from the DB table where it has been deposited by Oracle.
- Transfer this XML file (using HTTPS) to another server where it will be subsequently processed.
Would it be better to extract and dump the XML to a temp file on the local machine running the tool (the middle man), then upload this local file, or could the extraction and upload be done in one go: piping the XML output from the database server directly to its destination - thus saving the need for a temp file on the "middle man"?
What would be the best approach to facilitate this, and why? Could it be done without the need for temporary XML files?