BuildRiot
Sign in

Article · Backend

DocumentDB 1.0: Rehearse MongoDB compatibility and container upgrades

DocumentDB 1.0 reached general availability on October 19, 2026. This guide outlines a migration rehearsal covering workload replay, collation, aggregation and write correctness. Upgrading DocumentDB Local from 0.117 to 1.0 requires a new volume and reloading data; this guide proposes export and restore as the rehearsal method.

A miniature diorama shows paper records moving from an old glass container to a teal container on a blue base, alongside replay and verification tools.
Illustration: BuildRiot (AI-generated)

Key takeaway

A working driver connection does not establish application compatibility. Developers need matching query results, correct final data and measured downtime before approving a migration, plus a rollback plan that accounts for writes after cutover.

DocumentDB 1.0 puts compatibility to the test

Upgrading DocumentDB Local from 0.117 to 1.0 requires a fresh volume and reloading data. DocumentDB released version 1.0 on October 19, 2026. This guide proposes export and restore to rehearse that migration. The MIT-licensed project stores documents natively in PostgreSQL and provides a MongoDB-compatible interface. Its announcement describes 1.0 as a stabilization release following 0.117, with the same code as release candidate 2. The release makes application compatibility and data movement useful targets for a migration rehearsal. Sources: DocumentDB

The implementation has three components. pg_documentdb_core supplies document types and operations; pg_documentdb exposes APIs to create, read, update and delete documents. The gateway, pg_documentdb_gw, translates MongoDB requests into PostgreSQL queries. The project says most drivers, tools and queries work unchanged; that claim does not establish compatibility for a particular application. Standalone DocumentDB has its own gateway, while FerretDB 2 accesses the extension through FerretDB’s interface; Amazon DocumentDB is a separate product. Sources: DocumentDB, DocumentDB on GitHub

Freeze the baseline and replay actual operations

Start with a versioned experiment another engineer can repeat. Record the MongoDB server version, application commit, driver and connection options. Include topology, read and write concerns, and retry settings. For DocumentDB, record the image digest, PostgreSQL version, extension version and configuration flags. Published container tags cover PostgreSQL 15 through 18, while the latest tag points to PostgreSQL 17. Pin the version to make comparisons reproducible. Sources: DocumentDB on GitHub

Capture representative operations, including scheduled jobs, imports, cleanup tasks and rare error paths. Preserve options, projections, batch sizes, pipelines and session boundaries. Prepare identical sanitized starting data. Keep document types, missing fields, explicit nulls, nested arrays and numeric boundaries intact. Inventory indexes, validators, views and collection options separately. Use the following sequence to distinguish correctness failures from concurrency effects.

  1. Replay operations deterministically against isolated databases, resetting data between write runs.
  2. Compare documents, field types, affected counts, upsert identifiers, errors and final collection contents.
  3. Compare ordering where the query promises it, without sorting away an ordering defect.
  4. Replay realistic concurrency while preserving dependencies, hot keys and approximate arrival rates.
  5. Classify mismatches as unsupported operations, semantic differences, configuration gaps, restore failures, nondeterminism or test defects.

Give every case a durable record linking its inputs, environment and outcome. Assign one decision: passes unchanged, passes with documented configuration, requires application changes or blocks migration. Set acceptance criteria before reviewing timings so speed cannot excuse a correctness failure. The following record format keeps a mismatch reproducible.

case_id
source_server / target_image_digest / extension_version
driver_version / configuration_flags
initial_dataset_id / index_definitions
command_and_options
expected_result / actual_result
expected_final_state / actual_final_state
error_code / latency / reproducibility
classification / migration_decision

Separate collation matching, ordering and writes

DocumentDB’s configuration reference says collation defaults to disabled and can be enabled per PostgreSQL session. Enabling it leaves the restrictions shown in the table below. MongoDB’s driver specification includes collation options for updates, deletes, distinct and aggregation. Successfully constructing a driver request therefore does not establish server support. Confirm that the setting reaches PostgreSQL sessions serving gateway traffic. Sources: DocumentDB, MongoDB Specifications

Table

DocumentDB collation restrictions by operation

OperationDocumented restriction
find, aggregate, count, deleteReject collation while the flag is disabled
distinct, findAndModify, updateReject collation even with the flag enabled
$bucket, $bucketAuto, $densify, $fillReject collation
$geoNear, $merge, $setWindowFields, $sortByCountReject collation
Enabling collation leaves operation and aggregation-stage restrictions.Source: DocumentDB

Run the following fixture independently on each database, treating MongoDB’s measured results as the baseline. It probes accent and case matching, numeric ordering and grouping. Repeat with the application’s locales, explicit options and collection defaults. Test first without indexes, then with the intended indexes. MongoDB documents that string comparisons need matching query and index collations to use the relevant index. Views do not automatically inherit collection collation. Sources: MongoDB

db.collation_probe.insertMany([
  {_id: 1, label: "cafe"},
  {_id: 2, label: "café"},
  {_id: 3, label: "CAFE"},
  {_id: 4, label: "item2"},
  {_id: 5, label: "item10"}
]);

db.collation_probe.find({label: "cafe"})
  .collation({locale: "en", strength: 1});

db.collation_probe.find({})
  .collation({locale: "en", numericOrdering: true})
  .sort({label: 1, _id: 1});

db.collation_probe.aggregate(
  [{$group: {_id: "$label", n: {$sum: 1}}}],
  {collation: {locale: "en", strength: 1}}
);

Extend those probes to equivalent update, delete and distinct requests. Record errors and execution plans alongside returned values, with collation both disabled and enabled. A read that matches correctly does not settle whether a write selects the same documents. Keep each operation’s outcome separate in the compatibility ledger.

Test aggregation paths and write failures

The release announcement reports fixes involving $getField, $setField, $firstN, $lastN and $documents inside $facet. The changelog records a 0.117 parallel partial-aggregation crash fix involving expression-based $min, $max, $first and $last. These are useful regression targets because operator support and execution-path correctness are separate questions. Exercise empty inputs, nulls, missing fields, mixed numeric types, tied sort keys and nested arrays through actual application pipelines. Sources: DocumentDB, DocumentDB on GitHub

Use disposable databases for disruptive cases. The release notes warn that distinct or filtered count on certain grouped views can crash the PostgreSQL backend and disconnect other sessions. They also document $lookup failures with wildcard indexes. Expensive $replaceAll or $regexFindAll calls can exceed the configured time limit without cancellation. Reproduce actual index definitions, output-stage permissions and timeout paths. Compare decimal preservation and numeric boundaries, allowing floating-point tolerances only where justified. Sources: DocumentDB

Write replay needs final-state checks. Generic plans can cause single-document updates or findAndModify with non-_id filters to miss matches, according to the release notes. An upsert can then insert a duplicate; the documented workaround forces custom plans. A committed write can also be retried after a lost backend reply. This can apply $inc twice even with driver retries disabled. Test repeated updates and ambiguous outcomes separately. Include provisioning tests because the setup-created administrator cannot create or drop users and roles through the affected commands. Sources: DocumentDB

Rehearse the fresh-volume container upgrade

DocumentDB Local does not support in-place volume upgrades in 1.0; replacing the image leaves the volume’s extension schema unchanged. Upgrading from 0.117 to 1.0 requires starting on a new volume and reloading data. Reused volumes must also match the image’s PostgreSQL major version. The announcement distinguishes native-package upgrades from containers and requires clean installations for release-candidate hosts or volumes. Plan the rehearsal around the new-volume requirement. Sources: DocumentDB

Populate a disposable 0.117 deployment with representative data and metadata, then save baseline query results. Establish an export window with writes paused. Record the export tool version, duration and archive size. The sequence below proposes export and restore as a rehearsal method for the new-volume and data-reload requirement. Preserve logs and investigate rejected metadata or options before accepting the restore. Sources: DocumentDB

How it works

Proposed container migration rehearsal

  1. ExportPause writes and export representative data.
  2. PreserveStop the old deployment cleanly and retain its volume.
  3. CreateStart a version-pinned 1.0 container on a new named volume.
  4. RestoreRestore the export and inspect the full log.
  5. VerifyCheck extension version, documents, indexes, views and application behavior.
  6. Roll backPractice returning to the preserved deployment.
DocumentDB Local requires a new volume and reloading data for the 0.117-to-1.0 upgrade. This guide proposes export and restore as the rehearsal method.Source: DocumentDB

Verify readiness before reconnecting the application. DocumentDB Local documents persistence at /data and port 10260. It is a single-machine container without replication or failover. The release notes identify the extension version as 1.0-0. The hello response exposes it through internal.documentdb_versions. Measure export, restore, index work and verification separately. Define how rollback would handle writes accepted after cutover. Sources: DocumentDB

Make correctness the performance gate

An October 2025 GitHub discussion about FerretDB plus DocumentDB contains performance reports pointing in different directions across different setups. Those observations do not establish standalone DocumentDB 1.0 performance. The workload and upgrade exercises proposed here remain untested, so they provide no measured compatibility, downtime or performance results. Begin timing only after the correctness ledger meets the application’s acceptance criteria. Sources: GitHub

Publish hardware, storage, topology, versions, resource limits, document distributions and index definitions alongside results. Specify durability settings, warm-up, cache policy, concurrency and run duration. Report throughput, latency percentiles, errors and resource consumption across repeated runs. Compare equivalent durability and availability configurations, keeping correctness results beside speed measurements. Approve a migration only when critical operations pass, measured downtime fits the service’s requirements, and restore and rollback rehearsals succeed.

Attribution

Sources

  1. 1DocumentDBDocumentDB 1.0 is hereSource published (UTC)
  2. 2DocumentDB on GitHubDocumentDB repository
  3. 3DocumentDB on GitHubDocumentDB releases
  4. 4DocumentDBDocumentDB 1.0 release notes
  5. 5DocumentDBConfiguration
  6. 6MongoDB SpecificationsCollation
  7. 7MongoDBMongoDB collation
  8. 8DocumentDB on GitHubDocumentDB changelog
  9. 9DocumentDBDocumentDB Local
  10. 10GitHubQuestions about performance of FerretDB + DocumentDB

Read the original source for full details and context.

Report a problem

Links, dates or what you expected. Do not include passwords or private data.

More on Backend

All Backend stories

Review · Backend

Review: PostgreSQL 19, a relational database with new maintenance controls

PostgreSQL 19 adds concurrent table repacking that permits access during most of the work. The PostgreSQL Global Development Group released this version of its open-source relational database on November 19, 2026. According to the project, pg_plan_advice influences planner choices, while pg_stash_advice stores and applies guidance by query identifier. The release also adds logical replication of sequence values, get-or-create operations and JSON export.

PostgreSQL

Review · Frontend

Review: MoonBit 1.0 release candidate, a language for WebAssembly and native apps

MoonBit released its 1.0 release candidate on November 26, 2026, freezing compiler changes to bug fixes until 1.0. Its primary targets are native code and WebAssembly, with JavaScript support for browsers and interfaces. The team targets February 18, 2027, for the full release with a stable core library. The async and archive packages may still receive minor API refinements. The moon fix command can apply compiler-suggested fixes.

MoonBit

DocumentDB 1.0: Rehearse MongoDB compatibility and container upgrades · BuildRiot