Is it still possible to have multiple database connections in v4?
In v3 we can define multiple database connections in the database.js configuration and have different connections for each collection. However this does not seem to be the case in v4.
My use case is to be able to use read replica DBs on a collection that is frequently accessed, and use read/write database for the rest. May I ask if is this behavior would be possible in v4?
This is really frustrating, things that worked on V3 doesn’t work on V4.
Developers have various reasons to do so, one important reason being that if you want to separate two very different set of functional components in a database.
In my case, I use Postgres and use a database with two schemas, one for UI interactivity and logic and then I use another schema within the same database for analytics. I require Strapi to connect to both schemas.
This is not possible with Strapi V4. Very frustrating to learn that functionality that worked in a previous version is now missing. I wouldn’t upgrade to V4 if V3 had sufficient support for customising requests.
This is a lose-lose situation as I have no way of combining best of both versions.
I found this has been covered previously in another post, but this solution requires an external ProxySQL server. Is it not possible to direct all writes to a master db and all reads to the read replicas within the strapi database config?