skip to content

In MongoDB Atlas, how do database users differ from the users who sign in to the Atlas console?

level: juniorimportance: must knowfreq 66%

answer

  1. Two different kinds of user entirely
  2. One signs into the console, one into the cluster
  3. The credential is scoped to a project
  4. Roles come from MongoDB, plus atlasAdmin
  5. Project Owner grants zero data access

basics

~20 s

Atlas console accounts are organization and project members who manage the deployment through the UI or Admin API. Database users are separate credentials, created per project, that authenticate to the cluster itself and carry MongoDB roles such as readWrite on named databases.

solid answer

~50 s

Atlas has two independent identity systems. **Control-plane identities** — organization and project members, teams, and programmatic API keys — sign in to the Atlas console or call the Admin API to create clusters, edit the IP access list, or trigger a restore. **Database users** live under Database Access, are scoped to an Atlas *project* (so one user can reach every cluster in that project unless you restrict it to named clusters), and are what a driver or `mongosh` authenticates with. A database user is defined by an authentication method — SCRAM username/password, X.509 certificate, AWS IAM, or OIDC workforce/workload federation — plus roles: the built-in MongoDB roles (`read`, `readWrite`, `dbAdmin`, `readAnyDatabase`, `clusterMonitor`, `backup`), Atlas's own `atlasAdmin`, or a custom role you define. Being a Project Owner grants you no data access at all; you would still have to create yourself a database user first.

go deeper

for a junior

Be ready to state plainly that the account you log into Atlas with is not the account your driver connects with, and to name where database users are created and what a role like readWrite grants.

for a middle

Explain the scoping rules — project-level users, optional per-cluster restriction — and the available authentication methods, including why AWS IAM or X.509 removes a stored password from the deployment.

for a senior

Show judgment about least privilege in a managed service: custom roles over readWriteAnyDatabase, temporary users for humans, federation instead of per-person credentials, and a rotation plan that does not require downtime.

for a principal

Own the boundary design: project-per-environment so users, access lists and alerts are isolated together, federated identity mapped to database roles, and an auditable story for who can reach production data and how that access expires.

## Two separate identity planes Atlas is a control plane wrapped around MongoDB deployments, and each half has its own notion of "user". The **control plane** is the Atlas account hierarchy: an *organization* contains *projects* (historically called groups), and people are invited into either with roles like Organization Owner, Project Owner, Project Read Only, or Project Data Access roles. These identities sign in to the Atlas console, are managed through Access Manager, can be grouped into teams, and can be federated to a corporate identity provider. Automation uses the same plane through Atlas Admin API keys or service accounts. What they operate on is infrastructure: creating and scaling clusters, editing the IP access list, configuring backup policies, running restores, setting alerts. The **data plane** is the cluster itself, which speaks the MongoDB wire protocol and knows nothing about Atlas roles. To read or write documents you need a *database user*, created under Database Access. That user is a credential Atlas provisions on every cluster in the project. The most common junior mistake is assuming the first implies the second. A Project Owner who pastes the connection string into `mongosh` and types their Atlas console password gets an authentication failure, because that password is not a database credential. ## Scope of a database user Database users belong to a **project**, not to a cluster and not to an organization. Create one in project *payments-prod* and it exists on every cluster in that project; it does not exist in *payments-staging*. This is one of the strongest arguments for using a project per environment: the project is the boundary for database users, the IP access list, and alert configuration all at once. Atlas can narrow that further. A database user can be restricted to specific clusters or federated database instances in the project, which is how you give an analytics job access to one replica-only cluster without also handing it production. ## Authentication methods - **SCRAM** (username and password) is the default and what most connection strings use. Atlas authenticates these against the `admin` database, which is why the `authSource=admin` semantics are baked into the SRV connection string it hands you. - **X.509** certificates, either with Atlas as the CA or with your own CA, remove the shared password from the connection string. - **AWS IAM** lets an application assume a role on EC2, ECS, EKS, or Lambda and authenticate with temporary STS credentials, so no database password is stored anywhere. - **OIDC workforce and workload identity federation** maps identity-provider groups to database roles, which is how larger organizations avoid minting one Atlas database user per human. Dedicated tiers also support LDAP, but the modern recommendation for human access is federation rather than per-person SCRAM users. ## Roles The roles available are ordinary MongoDB roles plus one Atlas addition: - Per-database: `read`, `readWrite`, `dbAdmin`. - Cluster-wide: `readAnyDatabase`, `readWriteAnyDatabase`, `dbAdminAnyDatabase`, `clusterMonitor`, `backup`. - `atlasAdmin`: Atlas's broad administrative role over the data in the project's clusters. It is a data-plane role — it does not let anyone resize a cluster or change billing — but it is far more than an application needs. You can also define **custom roles** in Atlas, composed of actions and other roles, when the built-ins are too coarse. Atlas deliberately does not expose `root` or internal system roles; the deployment is managed, so a handful of privileged actions stay with the platform. Atlas also supports **temporary users**: a database user marked with an expiry that Atlas deletes automatically. That is the right shape for break-glass or contractor access, because the cleanup is not left to a human's memory. ## What this means in practice Give the application its own database user with the narrowest role that works — usually `readWrite` on one database — and never `atlasAdmin`. Give humans access through federation or short-lived temporary users. Remember that deleting someone's Atlas console account does not revoke any database user they created, and that rotating a database user's password is a data-plane change requiring an application redeploy or a secret-manager refresh, not an Atlas console permission change. Finally, the database user is only half of the gate. Even with perfect credentials, a client whose source address is not on the project's IP access list never gets far enough to authenticate — it sees a connection timeout instead. Authentication and network admission are independent controls in Atlas, and both must pass.

  • An application gets an authentication failure against Atlas even though the password is correct. What would you check?
    That the user exists in this project and not a neighbouring one, that the connection string's authentication mechanism matches how the user was created (SCRAM versus X.509 or AWS IAM), and that the SRV string Atlas generated is used unmodified. Note that a missing role produces an authorization error on the first operation, not an authentication failure — so distinguish the two error messages before changing anything.
  • How would you grant an analyst read-only access to one database on one cluster?
    Create a database user with the `read` role on that single database, use Atlas's restriction to bind the user to that one cluster, and set an expiry if the access is time-boxed. If `read` is still too broad, define a custom role limited to the collections they need. Avoid `readAnyDatabase`, which quietly grants every current and future database in the project.
  • What does the atlasAdmin role actually cover?
    It is a broad data-plane administrative role over the databases in the project's clusters — administrative commands and full read/write. It does not confer any Atlas control-plane power: an atlasAdmin database user cannot scale a cluster, edit the IP access list, or start a restore. It is still far too much for an application connection string.

The Atlas console account is the badge that gets you into the building and lets you order more servers; the database user is the key to the filing cabinet inside. Owning the building does not open the cabinet.

saying these in an interview costs you the question

  • Thinks an Atlas Project Owner can automatically read cluster data
  • Puts atlasAdmin in the application's connection string
  • Believes database users are created per cluster, not per project
  • Confuses the IP access list with authentication
  • Assumes removing an Atlas console account revokes database credentials

context