MazamaScience/beakr

Comparison with plumber

Closed this issue · 3 comments

Apologies for the unsolicited question but, having tested and been impressed at the 'hello world' example, I'm wondering how this compares with the plumber package. Context: @layik and I have used plumber as the basis of a package to visualise and serve geographic data, and am wondering if this package could have advantages as an R backend...

Thanks for sharing, looks like an impressive project with great potential!

Robin, Thanks for your interest in beakr.

We use beakr as the web service engine behind an operational Forest Service site displaying Monitoring data: https://tools.airfire.org/monitoring/v4

As described in the README, beakr is a ground up rewrite of the jug package which is now defunct. When plumber came out, we assessed it as a possible replacement but found it too constricting for what we wanted to do.

The beakr package tries to do for R what NodeJS Express does for javascript or Flask does for python. It tries to be absolutely minimalist and provides only core features: 1) stand up a web server; 2) map URL routes onto chunks of R code; 3) serve up static files; 4) handle errors.

We found the plumbr package to be targeted at those who have an R package with a well defined API who want to make that API available as a web service. For us, that is too restrictive. We want to define REST services first and then write whatever code we want to handle each REST URL. This allows us to add all sorts of cacheing, error handling and other code required in an operational system.

As an example of how we write scripts using beakr (and also MazamaCoreUtils) you should have a look at the beakr script for a plot service we currently have up to monitor AWS instances:

https://github.com/MazamaScience/mazama-plot-service/blob/master/plot-service/R/plot-service-app.R

The rest of that repository contains all the code needed to run this script in a docker container on our server. The results can be seen in a request for the API:

http://tools.mazamascience.com/plot-service/v1

or in a request for a plot:

http://tools.mazamascience.com/plot-service/v1/server-load?serverid=data-purpleair1.airfire.org&lookbackdays=3&ymax=2

I hope that answers some of your questions. Let me know if you have any more.

We are always happy to help folks doing open source environmental science!

Hi @jonathancallahan many thanks for your detailed reply. Sounds very interesting a promising. I'll close this issue as it answers my question but will keep a close eye on this project and potentially use it in future projects, will communicate if so!

layik commented

Thanks for the tag @Robinlovelace and thanks for the replies @jonathancallahan. Flask and Express would certainly attract my attention. I had seen jug before resting on plumber.