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
đ 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.
đī¸ 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
đ¤ 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
đ 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.
| Tier | Best for |
|---|---|
| Free (M0) | Learning, experimentation, small prototypes |
| Flex | Development, testing, and variable-traffic production apps |
| Dedicated (M10+) | Production workloads needing predictable, dedicated resources |
Important
đ¤ 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
đĸ 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 100Tip
đ§Š 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
đ 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=majorityCaution
đ 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@shopTip
đ 13. Network Access
Atlas clusters aren't publicly reachable by default â you must explicitly configure which IP addresses or VPCs may connect.
Warning
đ 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
đž 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
đ 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
đī¸ 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
đĨī¸ 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
đ 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
- Leaving 0.0.0.0/0 in the network access list for a production cluster.
- Hardcoding database credentials directly into application source code.
- Assuming the legacy Shared (M2/M5) or Serverless tiers are still available when creating new clusters â both have been retired in favor of Flex.
- Skipping backup configuration on a production Dedicated cluster.
- Ignoring Atlas alerts until they escalate into a full incident.
Best Practice
â 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.