ted.strauss
ted.strauss

Reputation: 4339

Can the R compiler be used with a web server?

I'm interested in using a statistical programming language within a web site I'm building to do high performance stats processing that will then be displayed to the web. I'm wondering if an R compiler can be embedded within a web server and threaded to work well with the LAMP stack so that it can work smoothly with the front-end and back-end of the web site and improve the performance of the site. If R is not the right choice for such an application, then perhaps there is another tool that is?

Upvotes: 1

Views: 293

Answers (2)

Dirk is no longer here
Dirk is no longer here

Reputation: 368261

You are confusing two issues.

Yes, R can be used via a webplatform. In fact, the R FAQ has an entire section on this. In the fifteen+ years that both R and 'the Web' have ridden to prominence, many such frameworks have been proposed. And since R 2.13.0 R even has its own embedded web server (to drive documentation display).

Yes, R scripts can run faster via the bytecode compiler, but that does not give you orders of magnitude.

Upvotes: 3

mbq
mbq

Reputation: 18628

The general rule is that webserver should do NO calculations -- whatever you do, it will always end in a bad user experience. The way is that the server should respond to calculation request by scheduling the job for some worker process, give the user some nice working status and then push the results obtained from worker when they are ready (most likely with AJAX polling or some more recent COMET idea).

Of course this requires some RPC protocol to R and some queuing agent -- this can be done either with background processes (easy yet slow), R HTTP servers (more difficult yet faster), or real RPC like Rserve or triggr (hard, yet fast to ultra-fast).

Upvotes: 4

Related Questions