Are there any examples of fast/responsive Shiny apps using "big" datasets? Is this feasible?

Hi everyone,

I've got a Shiny app that is simple, but renders interactive plots based on ~6GB worth of data. All data are currently deployed in memory with my app.R file in shinyapps.io, but the app loading time and app performance are horrendously slow.

I've looked into hosting the data in a MySQL database, using tips for faster data loading (like 'fread'), using performance boosting tricks (like bindCache), and consulting with experts to 'optimize' my the code (with trickys like decreasing redundant reactivity) - but it seems like the issue is proving quite tricky to resolve.

  1. In general, is there a significant difference in Shiny app speed depending on where the app is hosted (my own server vs shinyapps.io vs rstudioconnect ?)

  2. Will displaying my shinyapp on my website via an iframe (connected to the shinyapps.io url) have an effect on my apps loading speed?

  3. Are there any examples I can see of fast-loading, responsive Shiny apps that are based on larger (>5GB?) of data?

2 Likes

Shinyapps.io is relatively slower than your own server (depending on the plan). Try arrow package. Are you loading and doing data manipulation in global or server?

Keep the data in a database. Don't load it until it's necessary and if you load then load only the exact portion of the data you really need. If You run some standardized queries, you may try to design views in the backend and/or pre-calculated tables of the data you need most often. Another approach is to build an API service (plumber package) and design specialized endpoints to serve the data you need (filtered, sorted, aggregated etc.) so you don't have to transfer all the dataset. You may also consider using future package that allows you to do things in an asynchronous way.

I don't think you really need all the 6GB of data at once, right? Just keep it untouched until the moment you need a part of it and query only for this certain part. If you want to aggregate your data do it in the backend, don't transfer atomic data from the database to your shiny app.

1 Like