How to scale a DB and CPU intensive Panel app for multiple users?

Some random thoughts:

  1. Depending on how unique the database queries are, have you tried to use pn.cache? More ideas here on caching Discussion on best practices for advanced caching - please join - #14 by jbednar

  2. DuckDB is a great replacement for SQLite, but I assume your database isn’t SQLite

  3. Async is probably a good way forward, and with Panel magic, you don’t have to convert your entire app to become async, just your database queries. Just link it to a widget, like I did in ChatInterface here, here, and here.

  4. Maybe you could involve dask? Asynchronous Operation — Dask.distributed 2023.10.1 documentation