Shiny for large scale web development
R is a very powerful programming language for data analytics and has a lot of useful packages. Shiny framework enables R developers to build web based data analytics reports and tools. I personally find Shiny as a perfect framework for developing small web applications. But is it a good idea to develop a large scale web application (for example, BlurAdmin) with Shiny? I will give my opinion about this in this blog post.
Advantages of Shiny
Main advantages of using Shiny are:
- Access to the powerful R packages to do data analytics and create nice visualisation. R has a lot of amazing packages. Since Shiny is built on R, it can readily make a use of those packages. One should admit that Shiny might not be a reasonable choice for developing web applications which are not going to utilize the functionalities, which are provided by R and its packages. For example, I wouldn’t choose R and Shiny for a general purpose web development (personal or news website, blogs, e-commerce, etc).
- Seamless interaction between server and UI (User Interface). This is what it makes Shiny so attractive to the people who has little or no web development experience, like most of data scientists and statisticians. Using only one programming language, R, and never caring about REST web services and Ajax calls, one can build a simple web application in an hour. This fact can blow any full-stack web developer’s mind.
- Ready to use html templates (for example, shinydashboard and AdminLTE). Shinydashboard has helped me a lot so far to develop good looking web applications in short time. Though, unfortunately, there are not so many templates like shinydashboard so far. That’s why, if you look at the web applications, which were developed in Shiny, most of them look like one another.
Costs of high level programming framework
As one would expect, having so high level programming framework comes with its costs.
- Reactive programming might not be easy to understand and implement. R programmers all witnessed the steep learning curve of R language. Learning reactive programming for Shiny app development is the same type of experience. Reactive programming usually helps one avoid duplicate calculations but it’s difficult to learn and cumbersome to implement. It just sometimes is not what you want.
- No web service. Shiny handles all client-server interactions for you. Hence you don’t have to write REST web services yourself. I have listed this as an advantage of Shiny. However, in large scale software projects, you might also need to develop a mobile application for your software platform. For example, you would like to have a mobile app to view your data analytics reports. In this case, you will probably need to have a web service to serve your data to the mobile app. Therefore you’ll eventually have to develop a web service.
More points to discuss
- UI rooting and deep links. Sometimes it’s nice to have separate URLs for each page in your web application. It’s especially vital if you want your web pages to be listed in web search results. Or maybe you want to give a direct link of one of the pages in your web app to your customer. Either way, if you want to have page addresses or deep links, you might struggle to implement it in Shiny.
I listed main advantages of Shiny framework and what problems you might face when you develop a large scale web application with it. I find Shiny as a perfect framework for developing small data analytics tools. However, it’s not a silver bullet for building all types of web applications.