4 ms·
This is not REST API per se, but it's something that we've used in production for a couple years now and it's working like a charm https://github.com/robertzk/
by kirillseva 10y ago
This is not REST API per se, but it's something that we've used in production for a couple years now and it's working like a charm
https://github.com/robertzk/microserver https://github.com/robertzk/microserver
https://github.com/kirillseva/rain https://github.com/kirillseva/rain
This way our rails app can communicate with R prediction backend and we end up using the right tool for each task
- haddr 10y agoThanks! Just a question: is this microserver blocking? I mean when a request takes 2-3 sec, can it server other requests in parallel?
- kirillseva 10y agoIt's a wrapper around https://github.com/rstudio/httpuv https://github.com/rstudio/httpuv I'm pretty sure it's blocking though, R doesn't really have good concurrency primitives. However, you can launch multiple R processes behind nginx and be able to serve N requests concurrently. Running this in an autoscaling group on AWS provides enough resilience in practice
- haddr 10y agoYes, R is missing those, but there is some workarounds, like Shiny server (enterprise version) and OpenCPU for instance.