MongoDB Atlas Multi-Cloud

MongoDB Atlas Multi-Cloud (Azure PrivateLink, GCP PSC, Multi-Cloud Replica Sets)

When to Use This Skill

Skip for: Deep Azure-only content (DNS zones, NSG, Entra ID OIDC, AKS) → use mongodb-atlas-azure; Deep GCP-only content (Shared VPC, Workload Identity, GKE, Vertex AI) → use mongodb-atlas-gcp; AWS-only networking → use mongodb-aws-networking.

Setup Steps

  1. Request Private Endpoint in Atlas UI/API: POST /api/atlas/v2/groups/{groupId}/privateEndpoint/azure/endpointService
  2. Atlas creates Azure Private Link Service backed by Standard Load Balancer
  3. Azure creates NIC in your subnet with private IP
  4. Status sequence: Creating → Available

DNS

Private DNS Zone <cluster-id>.mongodb.net with A records pointing to private endpoint NIC IP. Zone must be linked to every VNet needing resolution.

Connection string: mongodb+srv://cluster0-pl-0.<cluster-id>.mongodb.net

Terraform Pattern

resource "mongodbatlas_privatelink_endpoint" "atlas" {
  project_id    = var.atlas_project_id
  provider_name = "AZURE"
  region        = "AZURE_EASTUS2"
}

resource "azurerm_private_endpoint" "atlas" {
  name      = "pe-atlas-eastus2"
  subnet_id = azurerm_subnet.private_endpoints.id
  private_service_connection {
    name                           = "psc-atlas"
    private_connection_resource_id = mongodbatlas_privatelink_endpoint.atlas.private_link_service_resource_id
    is_manual_connection           = true
  }
}

resource "mongodbatlas_privatelink_endpoint_service" "atlas" {
  project_id          = var.atlas_project_id
  private_link_id     = mongodbatlas_privatelink_endpoint.atlas.id
  endpoint_service_id = azurerm_private_endpoint.atlas.id
  provider_name       = "AZURE"
  private_endpoint_ip_address = azurerm_private_endpoint.atlas.private_service_connection[0].private_ip_address
}

GCP Private Service Connect (PSC)

Legacy vs Port-Mapped

DNS for PSC

Cloud DNS private zone. Allow TCP 27017 + high ports (1024-65535) through VPC firewall rules for SRV connection strings.

Multi-Cloud Replica Sets

Topology Options

3-node across 2 clouds (HA across clouds):

Write-concern latency: W:majority in multi-cloud = at least one write acknowledged from another cloud. Cross-cloud RTT typically 10-50ms. Use wtimeoutMS to prevent write stalls.

Read preference: Route reads to local secondary with readPreference: nearest + maxStalenessSeconds.

Cross-Cloud DR Pattern

RPO: Near-zero (replication lag typically <1 second for healthy cluster) RTO: 10-30 seconds for automatic election after primary failure

Egress Cost Analysis

Cross-cloud data transfer incurs egress charges:

For a 3-replica-set with 10 GB/day replication across clouds: ~$0.80/day in egress costs.

Mitigation: Keep primary and majority of nodes in lowest-cost cloud. Use hidden secondaries in DR cloud to limit replication traffic.

Marketplace Billing

Azure MACC

Atlas purchased via Azure Marketplace counts toward Microsoft Azure Consumption Commitment (MACC). Direct MongoDB invoices are NOT MACC-eligible.

MACC-eligible purchases: Atlas cluster compute/storage, Advanced Security, Dedicated Search Nodes, Stream Processing.

Azure Native MongoDB (ANM): First-party Azure resource in Azure Portal. Billing on Azure invoice (MACC-eligible). Generally at feature parity with standard Atlas.

GCP Committed Use Discounts (CUD)

GCP Marketplace Atlas purchases are EDP (Estimated Discount Program) eligible. GCP startup credits can be stacked. Committed use via GCP CUD contracts.

Partnership Programs

AWS ISV Accelerate / ISV Workload Migration Program

MongoDB is an AWS ISV Accelerate partner. Atlas clusters on AWS can qualify for AWS partner funding for customer migrations.

Azure Preferred Solutions / MACC Impact Program

MongoDB Atlas is an Azure Preferred Solution. Purchases via Marketplace impact partner competency and incentive credits.

GCP Startup Ecosystem

MongoDB participates in Google for Startups Cloud Program. Atlas credits available for eligible startups.

Anti-Patterns

References