I'm looking at creating a multi-tenancy app using Firebase and Firestore. The number of tenants will be low (something like 6 initially), and it won't be a thing where end users will be creating their own instances on the app, it will be tightly controlled by admins.
My ideal situation is to have just a single app that I can attach multiple domains to, and route requests to specific databases to fulfill them.
There are a few concerns I have:
I have read in documentation that I can create multiple databases per app, but don't see the options in my admin panel, so I'm not sure if the documentation is incorrect at present (or if it's referring to Realtime DB).
I won't want users who register to be registered to all tenants, and given the way that Firebase auth seems to work, I don't see any way that I can specify which domain the user is registering to. I had the thought to manage that in a collection that tracks which domains the user is a part of, and fake it to look like it's keeping the users siloed, but if a user registered in "two" tenants, and wanted to change their login credentials, that would change them across the network, and might be confusing.
So it sounds like that won't work as cleanly as I'd like, which would point me to option 2:
Have one frontend app, which has references to all firebase apps it can connect to, and contact the backends of separate apps to maintain a separation of data and user auth. This would solve the siloed user problem, but then I'd be maintaining several different apps on the backend, and the whole point of making the new version of this product is to get away from having to maintain multiple, similar but slightly different codebases. A solution to that issue would be to deploy from the same code repo to different apps on firebase: Would the CLI allow me to select my deploy target every time?
I suppose option 3 is to just have a headless React app contacting a node server or something, but then I'd lose all the cool Firebase goodness, and I'm really digging Firebase.
Is this a solvable problem? Or am I trying to jam a square peg into a round hole?
Thanks!