CorneR A small R Blog by Hao Zhu

When do you need a portable Shiny App?

Last year, Lee Pang wrote an amazing tutorial on how to set up a Desktop Shiny App with the portable version of R and Chrome. That post helped me a lot this year when I was trying to do a big proof-of-concept project to introduce shiny into the data management workflow in my work place. Now thanks to the success of that project, my institution is moving towards the server version of shiny and I would like to share some experiences I got during this progress in my recent posts before I say goodbye to this method.

When do you need a portable Shiny App?

After testing out portable Shiny Apps, community Shiny server and Shiny server Pro, I feel like I can share some of my opinions about these three options. Basically, you may want to consider a portable shiny app when:

1) You or your workplace demands data security
Shiny is great! However, the community version of shiny doesn't have SSL or authentication enabled. Sure, you can set up an NGINX over the top of the Shiny Server and enable SSL for that. However, to my limited knowledge, there is no easy way to set up authentication on Shiny server itself (You may set up an authentication within your Shiny App following this instruction. It might be a good way to go but it makes me feel a little uncomfortable). As a result, if you are working in an industry demanding high data security, you would better be cautious to put any data on the community version of Shiny Server.
On the other hand, the portable version, is actually pretty safe. Instead of settling on a private network, which allows everyone in your company be able to access it, it actually settles on the workstations of specific people. Someone has to log into that computer in order to use the Shiny App. Generally, using the portable version of Shiny App does neither increase nor decrease the security level.

2) You or your workplace/institution don't have enough budget to buy Shiny Server Pro
Shiny Server Pro offers solutions to address our security concern but...Man, it is very expensive. To the date this blog is written (10-23-2015), If you are using it for teaching, it's FREE. If you are doing research, it's 5K per year, and otherwise, it's 10k per year. Honestly speaking, this price is not bad at all comparing with other products on the market, like the SAS one, which I heard will take 75K annually. However, it is still expensive enough that people need to think about.

3) You have an IT-lockdown in your institution Many of us have our IT department holding the administrator right of our workstations. As an analyst, I sure have a copy of R on my computer but it would be a painful experience to help install R on our customers' (in many cases, our colleagues') computer, unless to say someone needs to maintain it and update R and its packages to the lastest version as you are using. In this case, using portable R with portable shiny seems to be a a straight-forward solution. If you don't have an IT-lockdown in your workplace, good for you. Then you can probably follow what is explained in Lee Pang's post to call the "real" R instead of the portable R on someone else's computer.

4) You prefer not to mass around with setting up a server
Setting up a shiny server can be easy, but it can also be complicated if you want to some customizations (eg, you want to install it on a copy of redhat/centOS). Coding inside a terminal might be good for nerds (like me), but I can see it might scare away a lot of people as well.

5) Your customers don't care too much about waiting
The portable version of Shiny is using the portable R, which is only available as the 32-bit version. Also, when you try to open up the protable shiny app, it starts from starting portable R, which also takes time. In practice, the lag is noticible but still in acceptable level. The app should be ready within 5 sec after you double-click the shortcut.

6) You know how to update R and R package on other people's computer I put this point at the very end but it is actually very important. It might sounds a little ridiculous but it is actually a very important question to think about when you are trying to design an app for a long-term project. The first thing you should keep in mind that, please don't expect other people to install/update R packages for you. I will explain the way I choose to solve this issue in another blog post.

Conclusion

While having a working Shiny Server Pro is still the ultimate solution, having a portable Shiny App may still work as "a solution" in many cases. It is free and safe. You don't need to worry about messing around with server and its speed is still acceptable. If you just start with Shiny and want to prove it to your senior-management team that this product worths something, I would say you should definitely check out this portable solution.