DEV Community

thorfinn
thorfinn

Posted on

Shared user database

hey guys, does anyone have an idea on how can I have multiple projects, each one using its own database with its own sets of collections But they share the same user collection. should I do separate databases ? but then how can I use functions like .populate() if am using MongoDB or how can I add a ref to users Id if they are not in the same database.
Thank u.

Oldest comments (1)

Collapse
 
michaldziuba03 profile image
Michał Dziuba

do you want to implement some kind of multi tenancy? mongodb.com/docs/atlas/build-multi...

Why just don't duplicate user data from "shared" users collection to each project database where user belongs? Does single user can belong to so many projects?