Multiple apps, one database


I would like to duplicate an app and tailor the new instance to a different target group. Most of the packages will be the same, some of them are different. Under the hood, both instances shall share the same database, using tenant ids in some of the collections, but other collections (like the users collection) will be used across both apps, so the users can log-in to both apps with the same credentials. Shared packages will reside in a folder referenced by PACKAGE_DIRS.

Is there anything database-related that I should consider setting up such a scenario?

(Another alternative would be to run both instances on one app and use a mechanism to detect the internet domain the user is using and deliver a tailored version of the app based on that domain. But neither do I know if such a setup is possible with mupx, nor do I think this would be easy to maintain. Plus, this would also mean that a server crash would affect both instances. Hence, I’d prefer to share code on a package level instead.)

EDIT: Another question related to that. Is there an easy way to point two local dev instances to the same database? I know that it’s possible to use a MONGO_URL environment variable, but could this also be achieved via settings.json?