Understanding the scalability of RShiny apps hosted on ShinyServer
I'd like to provide some notes related to your second question: Yes, you can use the mentioned buildback to deploy shiny applications on heroku.
I was in a similar situation with you (asking myself about possible ways of serving Shiny applications in a scalable manner) and decided to go the "heroku way".
You may find these hints helpful when deploying your app to heroku using the buildpack mentioned above:
Heroku tries to "guess" how to execute your application. But you can also add a special file, named
Procfile
, to your application to control the process commands you want to execute for your application. In my case I usedweb: R -f ~/run.R --gui-none --no-save
, where this means that a file namedrun.R
is being passed to theR
executable for the web server processThe stack on heroku is based on Ubuntu. If you need additional deb-packages, you can create another special file named
Aptfile
and add the package names therein, heroku will then automatically install these for you (I needed it forRPostgreSQL
)You can add another special file named
init.R
and install allR
packages as necessary just as you are used to, i.e. withinstall.packages
etc. You can also add initial configuration material within this file.
As a running example, here is an example toy application that I wrote for myself to remember how a "full-stack" shiny app may look like, including compability with heroku.
Canovice,
I'd recommend you take a look at the following RStudio / AWS support articles. To scale a shiny server you'll need to look at using a load balancer:
RStudio
- https://shiny.rstudio.com/articles/scaling-and-tuning.html
- https://support.rstudio.com/hc/en-us/articles/220546267-Scaling-and-Performance-Tuning-Applications-in-Shiny-Server-Pro
- https://support.rstudio.com/hc/en-us/articles/217801438-Can-I-load-balance-across-multiple-nodes-running-Shiny-Server-Pro-
AWS
- https://aws.amazon.com/blogs/big-data/running-r-on-aws/
Blog Article:
- http://mgritts.github.io/2016/07/08/shiny-aws/
Shiny is a great platform, their support is fabulous. I'd recommend you ring them up - they'll be sure to help answer your questions.
That said if your plan is to create a scalable website that will support thousands or hundreds of thousands of people then my sense would be to recommend you also review and consider using D3.js in conjunction with react.js or Angular.js, not forgetting to mention node.js.
My sense is that you are looking at a backend database connected to a logic engine and visualisation front end. If you are looking for a good overview of usage take a look at the following web page and git repo [A little dated but useful]:
- https://anmolkoul.wordpress.com/2015/06/05/interactive-data-visualization-using-d3-js-dc-js-nodejs-and-mongodb/
- https://github.com/anmolkoul/node-dc-mongo
I hope the above points you in the right direction.