Skip to content

R as a web service

2 messages · Carlos J. Gil Bellosta, Martin Morgan

#
Dear R-helpers,

I have been inquired about the possibility of developing a web
distributed scoring system: a model is created in a central location,
users fill a form in their browsers, and the central server calls this
model and returns a YES/NO answer to them.

I am tempted into using R for this assignment. I have used Rapache for
similar tasks, but I am afraid that it is too of a novelty for many
backward looking IT departments. For a number of reasons, a Java based
infrastructure (tomcat, web services, etc.) would be much more palatable
for them.

My wishlist is as follows:

* Minimal infrastructure changes in case of (statistical) model updates
or changes.
* Solid management of concurrence, so that simultaneous connections do
not interfere with each other.
* Maximum efficiency so that new connections do not require a fresh R
startup.

Any ideas on how to achieve this? Any documentation available?

Best regards,

Carlos J. Gil Bellosta
http://www.datanalytics.com
#
Carlos J. Gil Bellosta wrote:
Hi Carlos --

See RWebServices

  http://www.bioconductor.org/packages/bioc/html/RWebServices.html

as one possible solution. This produces a Java-based SOAP front end for
tomcat (probably good for the IT guys) with tasks dispatched to a series
of java-embedded R 'workers' to handle concurrency (probably not so good
for the IT guys, as this requires maintaining the infrastructure for the
service / worker communication and for handling gracefully the demise of
workers). The workers are persistent, and can have their R
implementation changed independent of the web service (though that is
not necessarily best practice). The relevant vignettes are 'Enabling
packages as web services' and 'Installing and testing...'. This is in
ongoing development, so use R-devel (and the appropriate RWebServices).

Martin