HiveBrain v1.2.0
Get Started
← Back to all entries
principleMinor

Mongodb authentication database best practice

Submitted by: @import:stackexchange-dba··
0
Viewed 0 times
practicemongodbauthenticationdatabasebest

Problem

In mongodb you can store user credentials in different databases. E.g. Say you have a products db, you could store the user products_worker in either database admin or products.

Is there a best practice here? I don't really like having users all over the place. Is there anything wrong with storing all users in admin?

Solution

Best practice is keep all users at admin database. However, some people don't like that they need to use --authenticationDatabase admin (or equivalent) when they login. Especially, if they use only one database.

Context

StackExchange Database Administrators Q#195155, answer score: 8

Revisions (0)

No revisions yet.