MongoDB Endpoint

MongoDB endpoints connect Eve to MongoDB-compatible deployments such as MongoDB Atlas, self-managed replica sets, sharded clusters, Amazon DocumentDB, and Azure Cosmos DB for MongoDB-compatible APIs.

MongoDB migration execution is a preview surface. Use this page to configure endpoints, understand command-aware routing, and plan a migration. Coordinate production execution with the Eden team until the public guided MongoDB workflow is available.

What Eve Uses MongoDB Endpoints For

MongoDB endpoints support:

  • Direct document operations through endpoint APIs.
  • Command-aware gateway and interlay planning.
  • OP_MSG and OP_QUERY parsing foundations.
  • Command classification and policy design.
  • Collection discovery and BSON batch movement planning.
  • Safe mirroring, comparison, and rollback design for preview migrations.

Basic Endpoint Shape

json
{
  "endpoint": "mongo-source",
  "kind": "mongo",
  "config": {
    "db_name": "app",
    "write_conn": {
      "url": "mongodb://user:password@mongo-source.internal:27017"
    }
  },
  "description": "Current MongoDB source"
}

Create it:

bash
curl -sS -X POST "$EDEN/endpoints" \
  -H "$AUTH_HEADER" \
  -H "Content-Type: application/json" \
  -d '{
    "endpoint": "mongo-source",
    "kind": "mongo",
    "config": {
      "db_name": "app",
      "write_conn": {
        "url": "mongodb://user:password@mongo-source.internal:27017"
      }
    },
    "description": "Current MongoDB source"
  }'

Create a target endpoint with the same shape and a different endpoint id and connection URL.

Connection Guidance

Document the topology before planning a migration:

AreaWhat to capture
Deployment typeStandalone, replica set, sharded cluster, Atlas, DocumentDB, Cosmos DB, or self-managed.
DatabasesUser databases in scope. Exclude system databases unless explicitly required.
CollectionsCollection counts, sizes, indexes, validators, capped collections, and time-series collections.
ShardingShard keys, balancer state, chunk distribution, and zone rules.
SessionsWhether applications use sessions, retryable writes, or multi-document transactions.
Change streamsWhether applications depend on change-stream behavior during migration.
CommandsAny administrative commands, destructive commands, mapReduce, aggregation pipelines, or custom driver behavior.

Command Policy

MongoDB migrations should classify commands before mirroring or dual-writing. A conservative policy should:

  • Allow common read commands for analysis and comparison.
  • Mirror only commands that are safe for the target and do not mutate state unexpectedly.
  • Block or require approval for destructive commands such as drop, dropDatabase, compact, repairDatabase, and dangerous administrative operations.
  • Skip or isolate transaction-shaped traffic until the execution plan explicitly supports it.
  • Record skip reasons so operators know which traffic was not compared.

Data Movement Planning

The planned MongoDB movement model is collection-aware:

  1. Discover non-system databases and collections.
  2. Sort work by estimated document count or size.
  3. Read documents in stable _id order where possible.
  4. Write bounded BSON document batches to the target.
  5. Apply the selected conflict mode.
  6. Record failed documents or collections for retry or manual review.

Conflict modes should be chosen before execution:

ModeBehavior
InsertInsert documents and fail if the target already has the same _id.
UpsertReplace or create target documents by identity.
MergeMerge fields where supported by the migration plan.
ManualRecord conflicts for operator review.

Validation

Use validation checks that match the workload:

  • Database and collection counts.
  • Document counts per collection.
  • Sampled document comparison.
  • Index presence and key pattern comparison.
  • Validator and collection option comparison.
  • Error records for failed batches.
  • Mirror divergence for safe commands.
  • Latency and error-rate comparison under mirrored traffic.

Interlay Planning

When using an interlay, applications connect to Eve instead of directly to the source. For MongoDB, test driver behavior carefully:

  • Initial handshake and topology discovery.
  • Authentication mechanism.
  • Read preference and write concern.
  • Retryable writes.
  • Sessions and transactions.
  • Aggregation pipelines.
  • Long-lived cursors and change streams.

Operational Status

The public guided workflow API documented in Migrations is Redis-specific today. MongoDB migration work should be treated as preview. Use endpoint docs, command-shape analysis, topology inventory, and architecture guidance for planning, then coordinate exact execution with the Eden team.

Last updated: October 20, 2018
    Eden | Govern AI Access