Any examples with interactive plots made in Shiny directly from MySQL (or similar) data using dbplyr?

Hi everyone,

I've got a Shiny app which makes a few simple interactive plots (scatterplots/histograms/etc), but using many possible data sources selected by user and stored in memory (packaged with the app.R file and deployed to These data collectively amount to ~6GB, and this render my app useless. >5 min loading time, very laggy performance.

After a bit of research, it seems that the solution should be to pull the data from a MySQL database. From my understanding, this should essentially solve my problem and produce a massive speed and performance boost, since only the app.R file will be stored in memory.

However - I'm not finding a whole lot of info on this. A couple of a videos from rstudio and a seldom blog post here and there about dbplyr, but all really brief stuff and nothing too comprehensive.

Are there any examples of this you know of or can provide? Is it generally a good idea to attempt tackling app speed issues by putting local data into a database?

Thanks for any and all advice!