0

I'm trying to find a good way to manage permissions for a high number of mongo documents.

What I want to do: Apply group/user/and or application permissions to mongo documents.

Idea 1: Use mysql to control the relationship (con's duplication of data, 2 diff systems)

Idea 2: Add metadata to each document (con's: would have to update a ton of doc)

Idea 3: Create another collection to manage the relationship (leaning toward this)

If anyone has a design pattern or any ideas I'd really appreciate it.

I'm dealing with high number of mongo docs (1 million+) and am trying to avoid the situation where I need to update a high number of doc's every time a new group/application/permission is added for a doc or subset of doc's.

2
  • What about role-based permissions? Wouldn't you avoid the situation described in your last paragraph if you restricted permissions to a particular role or roles? Commented Apr 28, 2020 at 19:36
  • Poss.. thing is we aren't using roles and I don't know upfront what the groups/users/applications are. So I'm trying to design a schema that can support future changes without having to update a ton of docs. I'm kinda leaning toward having one collection just for permissions and joining on the collection for docs. mongodb.com/blog/post/… Commented Apr 28, 2020 at 19:57

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.