I’m pondering building an open source project with RedwoodJS that follows a business model similar to Discourse’s and Ghost’s: hosting as a service.
To do so, I’m thinking about building a companion closed-source app that takes care of deploying new versions to the Google Cloud infrastructure. GC supports functions and CDN distribution, which should be enough for what I need.
The question that arises on my side is whether it makes sense to reuse functions across users. Unlike a Rails instance, for which it makes sense to have an instance running per user. What I’d have though is a database per user.
In case you see something like that as something feasible, I’m wondering how I could adjust the RedwoodJS functions to choose the database url depending on the domain. I’m thinking I could set up a second database connection to query the URL of the database the function should interact with. However, since the Prisma connection is managed by Redwood, I think it’ll be a bit tricky.
What do you think?