We're using metabase self-hosting and we have a replica DB we're reading the data from. I wanted to make use of Metabase's models and caching feature for complex queries because the dashboards are taking a long time to load.
From what I understood, I can make a model using a custom query, and store this model in a dedicated schema in the DB with a refresh schedule I will choose.
The issue is the database I'm using is a replica, read-only. So there's no way to write tables to this DB.
Is there a way to use a database by metabase itself?
Is there a way to connect a second DB and use it for caching only? So read data from DB 1, summarize it, and load data into DB 2 as models, then read those models from DB 2 all on metabase without using any third-party tools?
Currently, no. Metabase relies on the same database connection for model caching. You can use any query pooler to achieve that or you'd have to set up an ETL process to another database that Metabase can write to.