1

I have an R script that takes in arguments and returns a float value based on this input. I need to convert it into a RESTful API so that it can be accessed via a URL GET call. I have looked into the same and came across some very promising looking alternates - Plumber , OpenCPU and Jug. However I need a solution that will be robust and stable ( I am expecting almost 150 thousand calls in 10 mins as of now - might move towards real time so will be a bit relaxed than this) . Kindly help me answer the following questions :

  1. How to make a webservice that won't crash on production in case of hige traffic?
  2. How else can I call an Rscript logic from a JAVA web service without making them tightly coupled? (The script has barely 15 LOC)
  3. Is there a performance difference when it comes to making RESTful API in R v/s that in Python ?

Please direct me to anything that will help me understand this in the right manner.

I am very new to the concept of web services so I apologize in advance in case I asked stupid questions.

  • 1
    Is 1.5 lakh = 150000 (not everyone is indian here) ? This means 250 requests per second... [Plumber seems to be single-thread](https://www.rplumber.io/docs/runtime.html#performance-request-processing), so it will serve one request at a time... I would probably have a look to open-cpu... – digEmAll Apr 23 '18 at 07:41
  • I should have thought about it. Sorry and corrected the question statement. Thank you for the provided link. That does help a lot. How about the Python alternative and its performance ? – Resham Wadhwa Apr 23 '18 at 08:42
  • I don't know python very well... but, if you can translate your R code in python, I guess python has more possibilities for building a fast RESTful service (e.g. with Flask) – digEmAll Apr 23 '18 at 08:44
  • 1
    I would test-drive your script with different possibilities and add http://restrserve.org/ to the possible solutions. – Ralf Stubner Apr 23 '18 at 08:48
  • @digEmAll Thank you. I am looking into Python now. Thanks for your help. – Resham Wadhwa Apr 24 '18 at 07:57
  • @RalfStubner I was kind of hoping to avoid this. That is the last option - to compare all the alternates that are there but that would consume a lot time - I am new to web services and Python and the RESTful framework. But thank you . I will keep in mind. – Resham Wadhwa Apr 24 '18 at 07:58
  • @RalfStubner : oh, that's interesting ! – digEmAll Apr 24 '18 at 08:08

0 Answers0