Is this a good candidate for a web service?

Ok so I come from a completely different area of ​​software development, I have a problem that is slightly different from my experience. I will state this as clearly as possible without giving away confidential information:

  • I want to make a server that "does things" when requested by a client on the same network. The client will most likely be the back-end for the content management system.

  • The request consists of some parameters, an input file and several output files.

  • The files are quite large: 10 MB to 100 MB of data to be processed (possibly more). The client can specify the destination for the output files.

  • The client should be able to know the status of the request - for example, position in the queue, percentage complete. And, obviously, when and where to get the conclusion.

So my questions are - what is a good method for client-server communication? Should the client poll the server or provide a "callback" to update the status?

At this point, the implementation platform is completely open - anything from C to scripting languages ​​like Ruby is available (from both ends), my main problem is how the message is supposed to happen.

+2


source to share


2 answers


Think first, set up multiple web services between machines. But web services won't be too friendly or efficient with large files.

Simple application:

  • ServerA accesses the web method on ServerB "BeginProcess". The answer gives you FTP username / password and ticket number.
  • ServerA provides files for FTP location.
  • ServerA regularly checks the web method "GetProcessStatus (ticketNumber)", possible return values: Pending Files, Percentage Complete, Finished


A slightly more sophisticated approach, no polling.

  • ServerA accesses the web method on ServerB "BeginProcess (postUrl)" and you submit to the URL where you want to receive POSTed status updates. Answer: FTP username / password and ticket number.
  • ServerA provides files for FTP location.
  • ServerB sends updates to the POST location on ServerA every XXX% completed.

For added robustness, you'll save GetProcessStatus in case something gets lost on the air ...

+4


source


Files that are less than 100 MB are not a good choice for a web service, as you risk disconnecting the HTTP session before finishing processing.



Having a web service to check the status of these jobs would be more ideal. Control file transfers over FTP or whatever file transfer method you choose, and poll the web service for status updates. When the process is complete, you may have a returned URL for an output file that you can download.

+2


source







All Articles