MongoDB Atlas DeveloperGuide

Overview

Developer Data Platform
MongoDB Atlas

Atlas Database

Fully managed multi-cloud storage

Queryable Encryption

Query encrypted fields in-place

Auto-scaling

Compute & storage on demand

Vector Search

HNSW & IVF on embeddings

Atlas Search

Lucene full-text, fuzzy, facets

Global Clusters

Zone sharding for sovereignty

Triggers & Streams

Event-driven + stream processing

ACID Transactions

Multi-doc distributed guarantees

Online Archive

Tier cold data, still queryable

Time Series

Optimized time-stamped storage

Aggregation Framework

Server-side data pipelines

VoyageAI

Embeddings & reranking models

Granular Details

MongoDB Application Drivers

C#
Go
Java
JS
Python
PHP

MongoDB Atlas

MongoDB Universal Query API
P
S
S
A
R
🔍
Multi-region, Multi-cloud on AWS, Azure, and GCP

Data Ecosystem

Data Science Platforms
MongoDB Charts
Change Data Capture
Third-party BI & Reporting

Developer Tools

MongoDB Compass
MongoDB Shell
VS Code Extension
Data Explorer

Select a Component

Click on any part of the diagram to see more information here.

Disaster Recovery & Automated Failover

High availability is built into the core of MongoDB's replica set architecture. In the event of a primary node failure, Atlas automatically triggers an election to promote a healthy secondary to become the new primary, typically within seconds.

Node 1 (Primary)

Region: us-east-1

Writes Reads

Node 2 (Secondary)

Region: us-east-2

Reads

Node 3 (Secondary)

Region: us-west-1

Reads

This automated failover ensures your application remains available with minimal disruption. For disaster recovery, placing a secondary node in a separate geographic region (like Node 2 and 3) ensures data durability and availability for reads and writes even in the event of a full regional outage. [Ref: Replication Docs]

Sharding for Horizontal Scaling

When a dataset outgrows the capacity of a single server (vertical scaling), MongoDB uses sharding to distribute data across multiple servers (horizontal scaling). This allows for near-limitless scalability.

Application
Click to insert a document
mongos
Query Router

Shard A

Key range: A–I
P S S
0 docs

Shard B

Key range: J–R
P S S
0 docs

Shard C

Key range: S–Z
P S S
0 docs
Config Server RS
Chunk map & metadata
P S S

Key Components:

  • Shards: Each shard is an independent replica set storing a subset of the data, determined by shard key ranges.
  • mongos (Query Router): The application connects to mongos, not individual shards. It routes queries to the correct shard(s) based on the shard key.
  • Config Servers: A dedicated replica set storing the cluster's metadata — the chunk map that tells mongos which shard holds which key ranges.

The Shard Key is Critical

The choice of a shard key determines how data is distributed. A poor key leads to "hot shards" (bottlenecks), while a good key ensures even distribution. [Ref: Sharding Docs]

Shard Key Strategy Comparison

The choice of shard key defines how evenly data and queries spread across shards. Compare three common strategies below — click each tab to see the trade-offs.

Ranged Shard Key

Data is partitioned into contiguous ranges based on the shard key value. Documents with "close" shard key values are likely on the same chunk/shard.

Efficient range queries — one shard for sequential scans
Good for time-series or alphabetical lookups
Monotonic keys (timestamps) cause "hot shard" — all writes go to one shard
Uneven distribution if key values cluster
// Ranged on "lastName"
Shard 0
A — F
Shard 1
G — N
Shard 2
O — Z

[Ref: Shard Key Selection]

Global Deployments — Zone Sharding

Atlas Global Clusters use zone sharding to partition data across regions by a location field in the shard key. Each region owns its shard — writes are local to that zone and never cross the network. This gives you data sovereignty and single-digit millisecond latency for every user, everywhere.

Click a region to simulate a local write to that zone's shard

US AWS us-east-1 EU GCP europe-west1 APAC Azure japaneast Shard 1 (3-node RS) location: "US" 0 writes Shard 2 (3-node RS) location: "EU" 0 writes Shard 3 (3-node RS) location: "APAC" 0 writes ✕ No cross-region replication — each shard is independent, data stays in its zone

US Zone

CloudAWS us-east-1
ShardShard 1
Zone Keylocation: "US"
Local Latency~2ms
Data SovereigntyUS only

EU Zone

CloudGCP europe-west1
ShardShard 2
Zone Keylocation: "EU"
Local Latency~3ms
Data SovereigntyGDPR compliant

APAC Zone

CloudAzure japaneast
ShardShard 3
Zone Keylocation: "APAC"
Local Latency~2ms
Data SovereigntyAPAC only

The mongos router uses the location field in the shard key to route each document to the correct zone's shard. Data never leaves the zone. Each shard is a 3-member replica set for HA within the zone. [Ref: Global Clusters Docs]

Simplicity of Document Model

From 3NF to Document Model

Relational databases typically use 3rd Normal Form (3NF) schemas with multiple tables and foreign-key joins to reduce data redundancy. The document model simplifies this by embedding related data in a single document. Click a relational table to see how it maps to the intuitive document structure.

Private Network Routing Across Clouds

Atlas enables secure, private connections between your application's virtual network and your Atlas cluster, even across different cloud providers. This is achieved through VPC/VNet Peering and cloud-native Private Endpoints (AWS PrivateLink, Azure Private Link, GCP Private Service Connect).

VPC/VNet Peering

App VPC
Atlas VPC

Creates a direct, bi-directional private network connection between your application's VPC/VNet and the Atlas VPC. Traffic does not traverse the public internet. Supported on AWS, Azure, and GCP.

[Ref: Atlas Peering Docs]

Private Endpoints

Your VPC/VNet
Atlas Cluster
AWS PrivateLink
Azure Private Link
GCP Private Service Connect

Creates a secure, one-way endpoint from your network to the Atlas cluster. No CIDR management or firewall rules needed. Each cloud provider offers its native private endpoint service.

[Ref: Atlas Private Endpoint Docs]

Getting Started: Trial Environment

M0 Free Tier

Atlas offers a perpetual free tier called "M0 Sandbox." It's ideal for learning, prototyping, and early development.

  • 512 MB of storage
  • Shared RAM and vCPU
  • Basic monitoring and security features
  • Available on AWS, GCP, and Azure
Start Free