We have a multi-tenant micro-service (it's basically kafka with some bells and whistles). We are using Mongodb to store multi-tenant credentials and kafka data so the authentication is really tight. Like, tenant1 will get to read/write tenant1-db and it's collections, it has no other access, same with tenant2 and so on.. If for some reason I want to access tenant data I will have to login using credentials for that user on that database.
My question is, how do I create a full and incremental backup script for this? My concern is since I can't read other databases even as root without authenticating will I have to write a loop for it or something where it logs in for every user then uses mongodump and stores it in a file? Is there a simpler way? I know there's a user called backup but it can only take backup of the admin / root user and not other databases Every time there's a new tenant I feel like I will have to make changes to the backup script
I am fairly new to mongodb so I would appreciate some help. Thank you!