Is there any way to make R Shiny support multiple users? I'm talking about hundreds of concurrent users

Viewed 4130

Is there any way to make R Shiny support multiple users? I'm talking about hundreds of concurrent users. To add some context: I'm not talking about Authentication (username / password). That will be taken care of by Auth0 (see auth0.com). So AFTER they are logged in, I see that Shiny Server does not pass the username to the Shiny session (maybe deliberately, so that you are forced to purchase the Commercial license to Shiny Server?).My question is more about : a) how do I make it recognize the username of the logged in user? b) will it scale to hundreds of concurrent (simultaneous) users?

3 Answers

https://www.shinyproxy.io/ attempts to solve problem b): it spawns a Docker container per application and per user. It should scale well if you give it enough resources (unfortunately it's difficult to estimate what "enough" is beforehand... You should run your own tests).

I'm not sure about problem a) but Shinyproxy deals well with authentication of users.

The free version of Shiny Server can be enabled to utilize authentication before loading an app (a login screen) but does not then launch the shiny app as the user. This feature is only available in the pro version.

These cases are impossible with free Shiny Server

  • User logs in and the app executes a query against a secured database using the logged in identity
  • User logs in and the app recognizes them - free Shiny Server is already running under a user account and all users share that space.
  • User logs in and has their own private execution environment (if you have thousands of concurrent users you may well run into variable collisions which could expose what another user is looking at)

With the Shiny-Pro you can enable Authentification. The server then gives the App information about username over the variable session$user.

In the basic version Shiny-Pro can handle 20 Concurrent users but you can buy an extension so that it can handle up to 120 - 150 concurrent Users.

Related