I have a big SQL Server application that needs some help from R, and this R needs to load a large workspace in order to service the database request. I'd like to keep an R process running continually because loading the workspace takes about 1 minute. The data in the workspace doesn't change very often.

Rserve doesn't seem to align with my needs - I don't want a new workspace with each new connection, because I just have to load the large workspace I need each time.

So I want an R process with its workspace pre-loaded, sitting and waiting for requests from SQL Server. These would be simple requests, such as "make-forecast". The R process crunches and puts the answers back into the database using RODBC.

I think I need two pieces?


1)      Some R code to set up a small server listening for the "make-forecast" command

2)      An intermediate program that SQL Server talks to, which in turn talks to the running R process. I don't know if SQL server can communicate to R through a socket, that's why I think I need an intermediate program.

All of this (R, SQL Server) would run on the same Windows server box.

Some small code examples for 1) would be helpful, but advice would be better.


-          Mike Beddo

	[[alternative HTML version deleted]]

