â˜ī¸ MongoDB Atlas

MongoDB Atlas is MongoDB's fully managed cloud database service, handling provisioning, scaling, backups, and security so teams can focus on building applications instead of operating infrastructure. This tutorial walks through everything from creating your first cluster to advanced features like Atlas Search and Vector Search.

Information

Atlas pricing and tier names change periodically — the details in this tutorial reflect the platform as of 2026. Always confirm current options in the Atlas pricing page before making decisions.

📖 1. Introduction

Running MongoDB yourself means managing servers, patching software, configuring replication, and handling backups. Atlas removes that operational burden entirely, offering the same MongoDB you know as a managed service across AWS, Google Cloud, and Azure.

â˜ī¸ 2. What is MongoDB Atlas?

Atlas is a Database-as-a-Service (DBaaS) platform that provisions, monitors, and scales MongoDB clusters on your behalf. It bundles the core database with additional capabilities like full-text search, vector search, and built-in monitoring.

Atlas Platform
Managed clusters
Atlas Search
Vector Search
Backups & monitoring

đŸ›ī¸ 3. Atlas Architecture

Under the hood, every Atlas cluster is a properly configured replica set (or sharded cluster for larger tiers), running across multiple availability zones for built-in high availability.

Note

Even the smallest Atlas clusters are deployed as a three-node replica set by default, so failover protection is included from day one.

👤 4. Creating an Atlas Account

Sign up at mongodb.com/cloud/atlas to create an organization and project — Atlas's top-level containers for billing, access control, and clusters.

Tip

Organize related clusters (e.g., staging and production) into separate projects to keep access control and monitoring cleanly scoped.

🚀 5. Creating a Cluster

From the Atlas UI, choose a cloud provider, region, and cluster tier, then deploy — a new cluster is typically ready within a few minutes.

Creating a cluster via the Atlas CLI

# Creating a cluster with the Atlas CLI
atlas clusters create myCluster \
  --provider AWS \
  --region US_EAST_1 \
  --tier M10

đŸŽšī¸ 6. Cluster Tiers

Atlas organizes clusters into three broad tiers: Free, Flex, and Dedicated, each suited to a different stage of an application's lifecycle.

TierBest for
Free (M0)Learning, experimentation, small prototypes
FlexDevelopment, testing, and variable-traffic production apps
Dedicated (M10+)Production workloads needing predictable, dedicated resources

Important

Clusters can be scaled up at any time as requirements grow — MongoDB recommends starting on a lower tier and upgrading as real usage patterns emerge.

🤝 7. Shared Clusters

Atlas previously offered separate M2 and M5 "shared" cluster tiers for lightweight workloads. As of January 2026, these legacy shared tiers are no longer available — Atlas automatically migrated existing M2/M5 clusters to the newer Flex tier, which now serves this role.

Warning

If older documentation or tutorials mention M2 or M5 clusters, treat those references as legacy — new low-cost, low-traffic clusters should be created as Flex clusters instead.

đŸĸ 8. Dedicated Clusters

Dedicated clusters (M10 and above) provide dedicated vCPU and RAM resources, full feature access, and support for advanced capabilities like sharding and fine-grained backup schedules.

Creating a dedicated production cluster

atlas clusters create prodCluster \
  --provider AWS \
  --region US_EAST_1 \
  --tier M30 \
  --diskSizeGB 100

Tip

Reach for M30 or higher once a workload needs consistent, predictable performance rather than best-effort shared resources.

🧩 9. Serverless Instances

Atlas previously offered a dedicated Serverless instance type that billed purely by consumption. As of January 22, 2026, Atlas retired Serverless instances entirely — existing ones were automatically migrated to Free, Flex, or Dedicated clusters based on their usage patterns.

Danger

If you're building something new, don't reach for "Serverless" in the Atlas UI — it no longer exists as a separate option. The Flex tier now covers the same use case: unpredictable, variable-traffic workloads with capped, predictable pricing.

🔌 10. Connecting to Atlas

Atlas provides a ready-to-use connection string for each cluster, compatible with any official MongoDB driver.

Connecting to an Atlas cluster

const { MongoClient } = require("mongodb");

const client = new MongoClient(process.env.MONGODB_URI);
await client.connect();

🔗 11. Connection Strings

Atlas connection strings use the mongodb+srv:// scheme, which resolves the full replica set topology automatically via DNS, so you never need to list every node manually.

An Atlas SRV connection string

mongodb+srv://<username>:<password>@cluster0.abcde.mongodb.net/myDatabase?retryWrites=true&w=majority

Caution

Never hardcode credentials in a connection string committed to source control — use environment variables or a secrets manager instead.

🔑 12. Database Users

Atlas requires explicit database users with defined roles, separate from the organization-level account used to manage the Atlas project itself.

Creating a scoped database user

atlas dbusers create \
  --username appUser \
  --password "$(openssl rand -base64 24)" \
  --role readWrite@shop

Tip

Grant each application user the minimum role needed — for example, readWrite on a specific database rather than an admin-level role.

🌐 13. Network Access

Atlas clusters aren't publicly reachable by default — you must explicitly configure which IP addresses or VPCs may connect.

Warning

Adding 0.0.0.0/0 to the access list opens the cluster to any IP address — acceptable for quick testing, but a serious risk in production.

📝 14. IP Whitelisting

Add specific IP addresses or CIDR ranges to the network access list so only trusted sources can attempt to connect.

Whitelisting a specific IP address

atlas accessLists create --ip 203.0.113.42 --comment "Office network"

🔐 15. Atlas Security

  • All data is encrypted at rest and in transit by default.
  • VPC peering and Private Endpoints keep traffic off the public internet entirely.
  • Advanced Data Security features include client-side field-level encryption and auditing.
  • Role-based access control governs both database users and Atlas project members separately.

🔍 16. Atlas Search

Atlas Search embeds a full-text search engine directly alongside your data, powered by Apache Lucene, eliminating the need for a separate search infrastructure like Elasticsearch.

Querying with Atlas Search

await collection.aggregate([
  {
    $search: {
      index: "default",
      text: { query: "wireless mouse", path: "name" }
    }
  }
]).toArray();

🧠 17. Atlas Vector Search

Vector Search enables similarity search over embeddings — the numeric representations used by AI and machine learning models — making Atlas a natural fit for retrieval-augmented generation (RAG) applications.

Performing a vector similarity search

await collection.aggregate([
  {
    $vectorSearch: {
      index: "vector_index",
      path: "embedding",
      queryVector: [0.12, 0.98, -0.44 /* ... */],
      numCandidates: 100,
      limit: 10
    }
  }
]).toArray();

Example

Vector Search is commonly paired with an LLM to build semantic search and AI chatbot knowledge bases directly on top of existing operational data.

💾 18. Atlas Backup

Atlas offers continuous backups with point-in-time recovery, letting you restore a cluster to any moment within the configured retention window.

Tip

Backup availability and retention options vary by cluster tier — confirm current details on the Atlas backup documentation, since the Free tier doesn't include backup services.

📊 19. Atlas Monitoring

The Atlas UI provides real-time metrics dashboards covering operations per second, connections, replication lag, disk usage, and more — no separate monitoring tool required.

🔔 20. Atlas Alerts

Configure alerts to notify your team via email, Slack, PagerDuty, or webhook when metrics cross defined thresholds, such as high CPU usage or replication lag.

Tip

Set alerts on leading indicators like connection count or disk usage trends, not just hard failures — this gives you time to react before an outage occurs.

đŸ—‚ī¸ 21. Atlas Data Explorer

The Data Explorer is a built-in web UI for browsing collections, running queries, and editing documents directly — useful for quick inspection without opening a shell or client.

📈 22. Atlas Performance Advisor

Performance Advisor analyzes slow queries automatically and suggests specific indexes that would improve them, based on real query patterns observed on your cluster.

Tip

Review Performance Advisor suggestions periodically rather than only during an incident — many index gaps show up well before they cause visible slowdowns.

đŸ–Ĩī¸ 23. Atlas Integrations

Atlas integrates with common developer and infrastructure tools, including Terraform, Kubernetes Operator, AWS CloudFormation, and various CI/CD pipelines, enabling infrastructure-as-code management of clusters.

âŒ¨ī¸ 24. Atlas CLI

The Atlas CLI lets you manage clusters, users, and access lists entirely from the command line — ideal for scripting and automation.

Common Atlas CLI commands

atlas clusters list
atlas clusters describe myCluster
atlas clusters pause myCluster

đŸ› ī¸ 25. Atlas Administration

Beyond the CLI, the Atlas Administration API exposes every management operation programmatically, enabling full automation of cluster lifecycle, user management, and access control.

Reference

See the Atlas Administration API reference for the complete list of available endpoints.

🌟 26. Best Practices

  • Start with the tier that matches actual traffic, and scale up as usage data justifies it.
  • Restrict network access to known IPs or VPCs instead of leaving the cluster open to the internet.
  • Use scoped database users with the minimum role required for each application.
  • Enable continuous backups and periodically test restores for production clusters.
  • Review Performance Advisor recommendations regularly rather than reactively.

âš ī¸ 27. Common Mistakes

  1. Leaving 0.0.0.0/0 in the network access list for a production cluster.
  2. Hardcoding database credentials directly into application source code.
  3. Assuming the legacy Shared (M2/M5) or Serverless tiers are still available when creating new clusters — both have been retired in favor of Flex.
  4. Skipping backup configuration on a production Dedicated cluster.
  5. Ignoring Atlas alerts until they escalate into a full incident.

Best Practice

Treat your Atlas project structure — organizations, projects, and access lists — with the same care as your database schema; both are foundational to a secure deployment.

❓ 28. Frequently Asked Questions

Yes. The M0 tier remains free forever, offering 512MB of storage, ideal for learning and small prototypes.

Atlas retired Serverless instances as of January 2026. Existing instances were automatically migrated to Free, Flex, or Dedicated clusters, and the Flex tier now serves the same variable-traffic use case.

No. Features like Atlas Search, Vector Search, and managed backups are exclusive to Atlas — self-managed deployments would need separate tooling to replicate them.

📌 29. Summary

>>"Atlas turns MongoDB from something you operate into something you simply use."

Summary

MongoDB Atlas removes the operational overhead of running MongoDB yourself, while adding powerful capabilities like search and vector search on top. Explore the official Atlas documentation for the latest tier details, pricing, and feature updates as the platform evolves.