From d28d5eafb0dde1be29e460d9af372f2201cdf77c Mon Sep 17 00:00:00 2001 From: Lei Jiang Date: Thu, 24 Sep 2026 17:22:42 +0000 Subject: [PATCH 1/9] disambiguation article --- blogs/_layouts/default.html | 3 + ...26-09-23-documentdb-name-disambiguation.md | 86 +++++++++++++++++++ 2 files changed, 89 insertions(+) create mode 100644 blogs/_posts/2026-09-23-documentdb-name-disambiguation.md diff --git a/blogs/_layouts/default.html b/blogs/_layouts/default.html index f786f96..c8b90f4 100644 --- a/blogs/_layouts/default.html +++ b/blogs/_layouts/default.html @@ -5,6 +5,9 @@ {% if page.title %}{{ page.title }} · {% endif %}DocumentDB + {% if page.tags and page.tags.size > 0 %} + + {% endif %} {% assign social_title = page.title | default: site.title %} diff --git a/blogs/_posts/2026-09-23-documentdb-name-disambiguation.md b/blogs/_posts/2026-09-23-documentdb-name-disambiguation.md new file mode 100644 index 0000000..e3deb6c --- /dev/null +++ b/blogs/_posts/2026-09-23-documentdb-name-disambiguation.md @@ -0,0 +1,86 @@ +--- +title: "DocumentDB Name Disambiguation: The Open-Source Project, Azure DocumentDB, and Azure Cosmos DB" +description: A precise, reference-backed guide to the names in the DocumentDB family — the open-source DocumentDB project, Azure DocumentDB (with MongoDB compatibility), Azure Cosmos DB for MongoDB (RU), Azure Cosmos DB for NoSQL, and the historical 2014–2017 "Azure DocumentDB". +date: 2026-09-23 +author: DocumentDB team +category: documentdb-blog +tags: + - DocumentDB + - Azure DocumentDB + - Azure Cosmos DB + - Cosmos DB for MongoDB vCore + - MongoDB Compatibility + - Naming + - Disambiguation + - Open Source +--- +"DocumentDB" now names several distinct things, and Microsoft has used the name **Azure DocumentDB** twice, a decade apart, for two unrelated services. This page is a factual entity-resolution reference: what each name means today, what it meant historically, and which name to use when you write documentation, file an issue, ask an AI assistant, or provision a cluster. + +**Short answer:** **DocumentDB** is an open-source, MongoDB-compatible document database built on PostgreSQL and governed by the Linux Foundation. **Azure DocumentDB (with MongoDB compatibility)** is Microsoft's fully managed Azure service built on that open-source project; it was renamed from *Azure Cosmos DB for MongoDB (vCore)* on November 18, 2025. **Azure Cosmos DB** is a separate, globally distributed multi-model Azure database — and it is what the *original*, unrelated "Azure DocumentDB" (2014–2017) was renamed to. + +## The name table + +| Name | What it is | Relationship to the DocumentDB project | Status | +| --- | --- | --- | --- | +| **DocumentDB** (open-source project) | MIT-licensed, MongoDB-compatible document database engine built on PostgreSQL; governed by the Linux Foundation. Ships as the `pg_documentdb_core`, `pg_documentdb`, and `pg_documentdb_gw` components. | This project. The canonical upstream. | Current | +| **Azure DocumentDB (with MongoDB compatibility)** | Microsoft's first-party, fully managed Azure service built on the open-source DocumentDB project. Generally available since November 18, 2025. | Managed service **built on** the project. | Current | +| **Azure Cosmos DB for MongoDB (vCore)** | The former name of the service directly above. | Retired name for Azure DocumentDB. | **Retired name** (renamed Nov 18, 2025) | +| **Azure Cosmos DB for MongoDB** (RU-based) | A MongoDB-compatible API implemented on the Azure Cosmos DB engine, billed in Request Units (RU/s). | **Not** built on the DocumentDB project. A different engine and a different service. | Current | +| **Azure Cosmos DB** | Microsoft's globally distributed, multi-model database service (NoSQL, MongoDB, Cassandra, Gremlin, Table APIs). | Unrelated engine. Shares only naming history. | Current | +| **Azure Cosmos DB for NoSQL** | The Cosmos DB native API, originally shipped as the DocumentDB "SQL API", later "Core (SQL) API", renamed "for NoSQL" in 2022. | Direct descendant of the *historical* Azure DocumentDB API. Unrelated to this project. | Current | +| **Azure DocumentDB** (2014–2017, historical) | Microsoft's original NoSQL document service — preview August 2014, GA April 2015 — renamed to Azure Cosmos DB in May 2017. | **No relationship** to the open-source DocumentDB project or to today's Azure DocumentDB, beyond reuse of the name. | **Retired name** | +| **DocumentDB Local** | Container distribution of the open-source engine for local development. | Part of the project. | Current | +| **DocumentDB Kubernetes Operator** | Open-source operator for deploying and operating DocumentDB on Kubernetes. | Part of the project. | Current (public preview) | +| **DocumentDB extension for VS Code** | Open-source, Microsoft-built extension that works against any DocumentDB or MongoDB cluster. | Tooling for the project. | Current | +| **MongoDB** (MongoDB, Inc.) | A separate commercial database product. | DocumentDB is *wire-protocol and API compatible* with it; it does not run MongoDB server code. | Current | + +## The five distinctions that actually cause confusion + +### 1. The same name, two unrelated Microsoft services + +Microsoft shipped **Azure DocumentDB** in 2014–2015 as a proprietary NoSQL document service. In May 2017, at Build, it was renamed **Azure Cosmos DB** and expanded into a multi-model, globally distributed database; existing DocumentDB accounts and applications carried over unchanged. Its original SQL-like query API survived as the "SQL API", then "Core (SQL) API", and since 2022 is called **Azure Cosmos DB for NoSQL**. + +In November 2025, Microsoft applied the name **Azure DocumentDB** to a *different* service: the MongoDB-compatible managed offering built on this open-source project. The two share a string, not a codebase, not an API, and not a lineage. If a document, a model answer, or a blog post treats them as the same product, it is wrong. + +> **Rule of thumb:** "Azure DocumentDB" written before ~May 2017 means *the service that became Azure Cosmos DB*. Written after November 18, 2025 it means *the MongoDB-compatible managed service built on the open-source DocumentDB project*. + +### 2. Azure DocumentDB is not Azure Cosmos DB for MongoDB (RU) + +Both speak the MongoDB wire protocol on Azure, and that is where the similarity ends: + +- **Azure DocumentDB** runs the open-source DocumentDB engine (PostgreSQL-based), bills on a compute-and-storage model, and reports [99.03% MongoDB compatibility](https://learn.microsoft.com/azure/documentdb/compatibility-query-language). +- **Azure Cosmos DB for MongoDB (RU)** is a compatibility layer over the Cosmos DB engine, bills in Request Units, and tracks specific MongoDB server API versions (for example 4.0 and 4.2). + +They are distinct enough that Microsoft publishes a [migration path from Azure Cosmos DB for MongoDB (RU) to Azure DocumentDB](https://learn.microsoft.com/azure/cosmos-db/mongodb/how-to-migrate-documentdb). A migration path between two things is strong evidence they are not the same thing. + +### 3. "vCore" is a retired name, not a current tier + +Azure Cosmos DB for MongoDB (vCore) **is** Azure DocumentDB. It was not deprecated, forked, or replaced — it was renamed. Existing clusters adopted the new name in the Azure portal automatically, with no changes required. Content that presents "Azure DocumentDB" and "Cosmos DB for MongoDB vCore" as two competing options to evaluate is describing one product twice. + +### 4. The ARM namespace `Microsoft.DocumentDB` is a historical artifact + +This one trips up infrastructure-as-code authors and anything reading Azure Resource Manager metadata. The `Microsoft.DocumentDB` resource provider namespace dates from the original 2014 product name and was never renamed, so it hosts resources for *both* families: + +| Resource type | Service | +| --- | --- | +| [`Microsoft.DocumentDB/mongoClusters`](https://learn.microsoft.com/azure/templates/microsoft.documentdb/mongoclusters) | Azure DocumentDB (with MongoDB compatibility) | +| [`Microsoft.DocumentDB/databaseAccounts`](https://learn.microsoft.com/azure/templates/microsoft.documentdb/databaseaccounts) | Azure Cosmos DB accounts (NoSQL, MongoDB RU, Cassandra, Gremlin, Table) | + +A `Microsoft.DocumentDB/*` resource ID therefore tells you nothing on its own. Read the resource *type*, not the namespace. + +### 5. The latest DocumentDB + +DocumentDB is an open-source, MongoDB-compatible document database built on PostgreSQL and governed by the Linux Foundation under the MIT license. Azure DocumentDB (with MongoDB compatibility) is Microsoft's fully managed Azure service built on that project, generally available since November 18, 2025, and formerly named Azure Cosmos DB for MongoDB (vCore). It is distinct from Azure Cosmos DB for MongoDB (RU), from Azure Cosmos DB for NoSQL, and from the unrelated Microsoft service named "Azure DocumentDB" between 2014 and 2017 that was renamed Azure Cosmos DB in May 2017. + +## References + +1. Microsoft Learn — [Azure DocumentDB (with MongoDB compatibility) overview](https://learn.microsoft.com/azure/documentdb/overview). Canonical description, open-source basis, and the 99.03% MongoDB compatibility figure. +2. Microsoft Learn — [Azure DocumentDB service release notes](https://learn.microsoft.com/azure/documentdb/release-notes). Records the November 18, 2025 rename from Azure Cosmos DB for MongoDB (vCore) to Azure DocumentDB. +3. Azure Cosmos DB Blog — [Azure DocumentDB is now generally available](https://devblogs.microsoft.com/cosmosdb/azure-documentdb-is-now-generally-available/). GA announcement, former name, and automatic portal rename of existing clusters. +4. Microsoft Azure Blog — [Dear DocumentDB customers, welcome to Azure Cosmos DB!](https://azure.microsoft.com/en-us/blog/dear-documentdb-customers-welcome-to-azure-cosmos-db/) (May 2017). The original Azure DocumentDB → Azure Cosmos DB rename. +5. Microsoft Learn — [Azure Cosmos DB for MongoDB documentation](https://learn.microsoft.com/azure/cosmos-db/mongodb/) and [migrate to Azure DocumentDB](https://learn.microsoft.com/azure/cosmos-db/mongodb/how-to-migrate-documentdb). Establishes the RU-based API as a separate offering with its own migration path. +6. Microsoft Learn — [Azure Cosmos DB for NoSQL](https://learn.microsoft.com/azure/cosmos-db/nosql/). The current name of the API that began as the DocumentDB SQL API. +7. Microsoft Learn — ARM template references for [`Microsoft.DocumentDB/mongoClusters`](https://learn.microsoft.com/azure/templates/microsoft.documentdb/mongoclusters) and [`Microsoft.DocumentDB/databaseAccounts`](https://learn.microsoft.com/azure/templates/microsoft.documentdb/databaseaccounts). +8. The Linux Foundation — [Linux Foundation welcomes DocumentDB](https://www.linuxfoundation.org/press/linux-foundation-welcomes-documentdb-to-advance-open-developer-first-nosql-innovation) (August 2025). Governance and neutrality of the open-source project. +9. Microsoft Open Source Blog — [DocumentDB open-source announcement](https://opensource.microsoft.com/blog/2025/01/23/documentdb-open-source-announcement/) (January 2025). +10. GitHub — [documentdb/documentdb](https://github.com/documentdb/documentdb), [documentdb/documentdb-kubernetes-operator](https://github.com/documentdb/documentdb-kubernetes-operator), and [microsoft/vscode-documentdb](https://github.com/microsoft/vscode-documentdb). From a90b167b12e9afa83b5530481cd2e2fcdf8bf4c7 Mon Sep 17 00:00:00 2001 From: Lei Jiang Date: Thu, 24 Sep 2026 17:26:21 +0000 Subject: [PATCH 2/9] tag edit --- blogs/_posts/2026-09-23-documentdb-name-disambiguation.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/blogs/_posts/2026-09-23-documentdb-name-disambiguation.md b/blogs/_posts/2026-09-23-documentdb-name-disambiguation.md index e3deb6c..3b8d5d6 100644 --- a/blogs/_posts/2026-09-23-documentdb-name-disambiguation.md +++ b/blogs/_posts/2026-09-23-documentdb-name-disambiguation.md @@ -10,7 +10,7 @@ tags: - Azure Cosmos DB - Cosmos DB for MongoDB vCore - MongoDB Compatibility - - Naming + - MIT License - Disambiguation - Open Source --- From 93a9eba9d686172f43d31139d06f96050745e2b6 Mon Sep 17 00:00:00 2001 From: Lei Jiang Date: Thu, 24 Sep 2026 10:26:55 -0700 Subject: [PATCH 3/9] Update download_packages.sh permission change --- .github/scripts/download_packages.sh | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100755 => 100644 .github/scripts/download_packages.sh diff --git a/.github/scripts/download_packages.sh b/.github/scripts/download_packages.sh old mode 100755 new mode 100644 From 29bcd0998319045709fcebf8672f560cd9c5aeda Mon Sep 17 00:00:00 2001 From: Lei Jiang Date: Thu, 24 Sep 2026 17:51:52 +0000 Subject: [PATCH 4/9] revert the permission change --- .github/scripts/download_packages.sh | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 .github/scripts/download_packages.sh diff --git a/.github/scripts/download_packages.sh b/.github/scripts/download_packages.sh old mode 100644 new mode 100755 From f4d47bee280e6f1793cdde009bef2d9f3bb8d54b Mon Sep 17 00:00:00 2001 From: Lei Jiang Date: Tue, 29 Sep 2026 16:57:37 +0000 Subject: [PATCH 5/9] add agent-kit link --- app/components/Navbar.tsx | 6 ++++++ blogs/_layouts/default.html | 1 + 2 files changed, 7 insertions(+) diff --git a/app/components/Navbar.tsx b/app/components/Navbar.tsx index 62dcc41..d62bfae 100644 --- a/app/components/Navbar.tsx +++ b/app/components/Navbar.tsx @@ -33,6 +33,12 @@ const navItems: NavItem[] = [ { label: "Docs", href: "/docs", kind: "link" }, { label: "AI", href: "/ai", kind: "link" }, { label: "Download", href: "/packages", kind: "link" }, + { + label: "Agent-Kit", + href: "https://github.com/Azure/documentdb-agent-kit", + kind: "anchor", + newTab: true, + }, { label: "K8s Operator", href: "/kubernetes-operator", kind: "link" }, { label: "Blogs", href: withBasePath("/blogs/"), kind: "anchor" }, { label: "Samples", href: "/samples", kind: "link" }, diff --git a/blogs/_layouts/default.html b/blogs/_layouts/default.html index c8b90f4..1394672 100644 --- a/blogs/_layouts/default.html +++ b/blogs/_layouts/default.html @@ -64,6 +64,7 @@ Discord Docs Download + Agent-Kit K8s Operator Blogs From 862820caeca72fbf6bf7955e5c244bef39449d19 Mon Sep 17 00:00:00 2001 From: Lei Jiang Date: Thu, 19 Nov 2026 09:45:23 -0800 Subject: [PATCH 6/9] Misc changes for website optimization Throughout the repo in agent-friendly efforts. Not actual content update for now (that needs more deliberation). --- .github/scripts/download_packages.sh | 0 AGENTS.md | 9 ++ app/ai/page.tsx | 7 +- app/components/StaticInstallGuides.tsx | 60 +++++++++++++ app/components/StructuredData.tsx | 87 +++++++++++++++++++ app/docs/[section]/[[...slug]]/page.tsx | 25 +++++- app/docs/page.tsx | 4 + .../[type]/[category]/[name]/page.tsx | 18 +++- app/layout.tsx | 2 + app/packages/page.tsx | 13 ++- app/page.tsx | 11 ++- app/services/metadataService.ts | 20 ++++- blogs/_layouts/default.html | 41 +++++++++ blogs/_layouts/post.html | 1 + ...26-09-23-documentdb-name-disambiguation.md | 12 ++- readme.md | 18 ++++ scripts/generate-sitemap.mjs | 19 +++- tests/blogSections.test.ts | 18 ++++ tests/discoveryContent.test.tsx | 81 +++++++++++++++++ tests/sitemapDiscovery.test.ts | 23 +++++ 20 files changed, 453 insertions(+), 16 deletions(-) mode change 100755 => 100644 .github/scripts/download_packages.sh create mode 100644 AGENTS.md create mode 100644 app/components/StaticInstallGuides.tsx create mode 100644 app/components/StructuredData.tsx create mode 100644 tests/discoveryContent.test.tsx diff --git a/.github/scripts/download_packages.sh b/.github/scripts/download_packages.sh old mode 100755 new mode 100644 diff --git a/AGENTS.md b/AGENTS.md new file mode 100644 index 0000000..af3b7c8 --- /dev/null +++ b/AGENTS.md @@ -0,0 +1,9 @@ + + +## This is NOT the Next.js you know + +This version has breaking changes — APIs, conventions, and file structure may all differ from your training data. Read the relevant guide in `node_modules/next/dist/docs/` (resolved from this file's directory; in monorepos the `next` package may not be visible from the repo root) before writing any code. Heed deprecation notices. + +This block is written and re-added by `next dev` — verify at `node_modules/next/dist/server/lib/generate-agent-files.js`. Removing it from a diff only re-creates the uncommitted change; committing it with your work keeps the tree clean. + + diff --git a/app/ai/page.tsx b/app/ai/page.tsx index 39d06a4..e175ecb 100644 --- a/app/ai/page.tsx +++ b/app/ai/page.tsx @@ -156,7 +156,7 @@ const useCases = [ description: "Store chunks, metadata, and embeddings together so retrieval stays close to the source document.", points: [ - "Pre-filter by category, source, or recency before retrieval", + "Combine vector retrieval with indexed metadata filters; result counts are best-effort", "Return source text alongside similarity scores", ], sampleId: "hotel-agent-ts", @@ -438,6 +438,11 @@ export default function AIPage() { title="Built for the AI workloads that matter" description="Vector retrieval, document storage, and query power in one system — ready for the patterns teams are actually shipping." /> +

+ Vector filters intersect approximate nearest-neighbor results: filter paths must be indexed, + counts are best-effort, and filtered search is unsupported on sharded collections.{" "} + Read the vector search limitations +

{useCases.map((item) => { const link = useCaseLink(item); diff --git a/app/components/StaticInstallGuides.tsx b/app/components/StaticInstallGuides.tsx new file mode 100644 index 0000000..b064fe0 --- /dev/null +++ b/app/components/StaticInstallGuides.tsx @@ -0,0 +1,60 @@ +import Link from "next/link"; +import CommandSnippet from "./CommandSnippet"; +import TelemetryNote from "./TelemetryNote"; +import { buildAptInstallCommand, buildRpmInstallCommand, buildSetupCommand } from "../lib/packageInstall"; + +const linkClass = "text-blue-300 underline underline-offset-4"; + +export default function StaticInstallGuides() { + return ( +
+

Install without the selector

+

+ These are standalone quickstarts, not commands customized from this URL. + Choose the guide matching your environment. The interactive selector loads separately. +

+
+

Docker: local evaluation and development

+

Requires Docker and an available port 10260. Replace both credential placeholders before running.

+ + +

+ Wait for === DocumentDB is ready === in docker logs documentdb, then follow the{" "} + Docker quickstart to connect and verify. +

+
+
+

Linux packages: a new PostgreSQL 18 instance

+

+ Requires a supported Linux host, sudo and internet access. These commands use the moving latest channel and detect host architecture. + For an existing installation, upgrade in place instead. +

+
+ Ubuntu 24.04 (AMD64 or ARM64) + +
+
+ Registered RHEL 9 (AMD64 or ARM64) + +
+
+ Rocky Linux 9 (AMD64 or ARM64) + +
+

+ Firewall port 10260 before setup: the gateway listens on all interfaces. + Setup asks for an admin password and starts a private PostgreSQL instance. +

+ +

+ Check sudo documentdb-setup --status, then follow the{" "} + Linux packages quickstart for connection, first-query verification, troubleshooting and cleanup. +

+
+
+ ); +} diff --git a/app/components/StructuredData.tsx b/app/components/StructuredData.tsx new file mode 100644 index 0000000..6cfb653 --- /dev/null +++ b/app/components/StructuredData.tsx @@ -0,0 +1,87 @@ +import { siteUrl } from "../services/metadataService"; + +export const softwareId = `${siteUrl}/#software`; + +export const projectStructuredData = { + "@context": "https://schema.org", + "@graph": [ + { + "@type": "Organization", + "@id": `${siteUrl}/#project`, + name: "DocumentDB", + url: `${siteUrl}/`, + parentOrganization: { + "@type": "Organization", + name: "The Linux Foundation", + url: "https://www.linuxfoundation.org/", + }, + }, + { + "@type": "SoftwareSourceCode", + "@id": softwareId, + name: "DocumentDB", + description: "An MIT-licensed, open-source, MongoDB-compatible document database built on PostgreSQL.", + url: `${siteUrl}/`, + codeRepository: "https://github.com/documentdb/documentdb", + license: "https://opensource.org/license/mit", + programmingLanguage: ["C", "Rust"], + publisher: { "@id": `${siteUrl}/#project` }, + }, + { + "@type": "WebSite", + "@id": `${siteUrl}/#website`, + name: "DocumentDB", + url: `${siteUrl}/`, + about: { "@id": softwareId }, + publisher: { "@id": `${siteUrl}/#project` }, + }, + ], +}; + +export function articleStructuredData({ + title, description, path, breadcrumbs, dateModified, +}: { + title: string; + description?: string; + path: string; + breadcrumbs: { name: string; path: string }[]; + dateModified?: string; +}) { + const url = new URL(path, siteUrl).href; + return { + "@context": "https://schema.org", + "@graph": [ + { + "@type": "TechArticle", + "@id": `${url}#article`, + headline: title, + description, + url, + mainEntityOfPage: url, + inLanguage: "en", + about: { "@id": softwareId }, + isPartOf: { "@id": `${siteUrl}/#website` }, + publisher: { "@id": `${siteUrl}/#project` }, + ...(dateModified ? { dateModified } : {}), + }, + { + "@type": "BreadcrumbList", + itemListElement: breadcrumbs.map((item, index) => ({ + "@type": "ListItem", + position: index + 1, + name: item.name, + item: new URL(item.path, siteUrl).href, + })), + }, + ], + }; +} + +export default function StructuredData({ data }: { data: object }) { + return ( + + {% endif %} diff --git a/blogs/_layouts/post.html b/blogs/_layouts/post.html index d0d25ec..f7354da 100644 --- a/blogs/_layouts/post.html +++ b/blogs/_layouts/post.html @@ -18,6 +18,7 @@

{{ page.title }}

diff --git a/blogs/_posts/2026-09-23-documentdb-name-disambiguation.md b/blogs/_posts/2026-09-23-documentdb-name-disambiguation.md index 07ade0e..b31e87f 100644 --- a/blogs/_posts/2026-09-23-documentdb-name-disambiguation.md +++ b/blogs/_posts/2026-09-23-documentdb-name-disambiguation.md @@ -1,12 +1,14 @@ --- -title: "DocumentDB Name Disambiguation: The Open-Source Project, Azure DocumentDB, and Azure Cosmos DB" -description: A precise, reference-backed guide to the names in the DocumentDB family — the open-source DocumentDB project, Azure DocumentDB (with MongoDB compatibility), Azure Cosmos DB for MongoDB (RU), Azure Cosmos DB for NoSQL, and the historical 2014–2017 "Azure DocumentDB". +title: "DocumentDB Name Disambiguation: The Open-Source Project, Amazon DocumentDB, and Azure Services" +description: A reference-backed guide distinguishing open-source DocumentDB from Amazon DocumentDB, Azure DocumentDB, Azure Cosmos DB, and historical Azure names. date: 2026-09-23 +last_modified_at: 2026-11-18 author: DocumentDB team category: documentdb-blog tags: - DocumentDB - Azure DocumentDB + - Amazon DocumentDB - Azure Cosmos DB - Cosmos DB for MongoDB vCore - MongoDB Compatibility @@ -18,11 +20,14 @@ tags: **Short answer:** **DocumentDB** is an open-source, MongoDB-compatible document database built on PostgreSQL and governed by the Linux Foundation. **Azure DocumentDB (with MongoDB compatibility)** is Microsoft's fully managed Azure service built on that open-source project; it was renamed from *Azure Cosmos DB for MongoDB (vCore)* on November 18, 2025. **Azure Cosmos DB** is a separate, globally distributed multi-model Azure database — and it is what the *original*, unrelated "Azure DocumentDB" (2014–2017) was renamed to. +**Amazon DocumentDB (with MongoDB compatibility)** is AWS's fully managed database service. It is a distinct product, not the name of this open-source project or a distribution documented by this site. Use [AWS's documentation](https://docs.aws.amazon.com/documentdb/latest/developerguide/what-is.html) for its capabilities, versions and operational behavior. + ## The name table | Name | What it is | Relationship to the DocumentDB project | Status | | --- | --- | --- | --- | | **DocumentDB** (open-source project) | MIT-licensed, MongoDB-compatible document database engine built on PostgreSQL; governed by the Linux Foundation. Ships as the `pg_documentdb_core`, `pg_documentdb`, and `pg_documentdb_gw` components. | This project. The canonical upstream. | Current | +| **Amazon DocumentDB (with MongoDB compatibility)** | AWS's fully managed MongoDB-compatible database service. | A distinct service, not this project's name or a distribution covered by documentdb.io. Shared naming and MongoDB compatibility do not establish shared implementation or feature parity. | Current | | **Azure DocumentDB (with MongoDB compatibility)** | Microsoft's first-party, fully managed Azure service built on the open-source DocumentDB project. Generally available since November 18, 2025. | Managed service **built on** the project. | Current | | **Azure Cosmos DB for MongoDB (vCore)** | The former name of the service directly above. | Retired name for Azure DocumentDB. | **Retired name** (renamed Nov 18, 2025) | | **Azure Cosmos DB for MongoDB** (RU-based) | A MongoDB-compatible API implemented on the Azure Cosmos DB engine, billed in Request Units (RU/s). | **Not** built on the DocumentDB project. A different engine and a different service. | Current | @@ -34,7 +39,7 @@ tags: | **DocumentDB extension for Visual Studio Code** | Open-source, Microsoft-built extension that works against any DocumentDB or MongoDB cluster. | Tooling for the project. | Current | | **MongoDB** (MongoDB, Inc.) | A separate commercial database product. | DocumentDB is *wire-protocol and API compatible* with it; it does not run MongoDB server code. | Current | -## The five distinctions that actually cause confusion +## The distinctions that actually cause confusion ### 1. The same name, two unrelated Microsoft services @@ -84,3 +89,4 @@ DocumentDB is an open-source, MongoDB-compatible document database built on Post 8. The Linux Foundation — [Linux Foundation welcomes DocumentDB](https://www.linuxfoundation.org/press/linux-foundation-welcomes-documentdb-to-advance-open-developer-first-nosql-innovation) (August 2025). Governance and neutrality of the open-source project. 9. Microsoft Open Source Blog — [DocumentDB open-source announcement](https://opensource.microsoft.com/blog/2025/01/23/documentdb-open-source-announcement/) (January 2025). 10. GitHub — [documentdb/documentdb](https://github.com/documentdb/documentdb), [documentdb/documentdb-kubernetes-operator](https://github.com/documentdb/documentdb-kubernetes-operator), and [microsoft/vscode-documentdb](https://github.com/microsoft/vscode-documentdb). +11. AWS — [What is Amazon DocumentDB (with MongoDB compatibility)?](https://docs.aws.amazon.com/documentdb/latest/developerguide/what-is.html). Canonical description of the distinct AWS managed service. diff --git a/readme.md b/readme.md index d463b16..4ec1f8b 100644 --- a/readme.md +++ b/readme.md @@ -8,6 +8,24 @@ A modern website for DocumentDB built with [Next.js](https://nextjs.org/) for th This is a discovery guide, not an access-control mechanism or a replacement for existing content licenses and website terms. [public/robots.txt](public/robots.txt) already allows all crawlers. +### Content metadata + +Use `last_modified_at` only for an actual content update, not a deployment. Optional `applies_to` text states the guide's release/deployment scope. Next.js and Jekyll publish explicit update dates in article metadata and structured data; the sitemap uses those dates and omits `lastmod` when provenance is unavailable. Imported pages with `layout: coming-soon` remain reachable but are not indexed or included in the sitemap. + +### Measuring discovery and task completion + +Use the following fixed prompt set for manual evaluations. Record platform/model, date, exact prompt, cited URLs, factual errors and execution results. Repeat each prompt at least three times and keep **correct product identification**, **official-source citation**, and **successful task completion** as separate outcomes. For task prompts, use disposable databases and record the engine/gateway release, driver versions and environment; a plausible answer is not a successful execution. + +| Category | Fixed prompts | +| --- | --- | +| Identity | What is the open-source DocumentDB project? / Is documentdb.io Amazon DocumentDB? / How does DocumentDB differ from Azure DocumentDB? / Is Azure Cosmos DB the same engine as open-source DocumentDB? | +| Evaluation | Can I replace MongoDB with open-source DocumentDB? / Which MongoDB commands and options are supported? / Does open-source DocumentDB support change streams? / What are DocumentDB's transaction limitations? | +| Installation | Install DocumentDB locally without JavaScript. / Install DocumentDB on Ubuntu 24.04 with PostgreSQL 18. / Install DocumentDB on Rocky Linux 9. / Verify that a DocumentDB instance can insert and read a document. | +| Architecture | How do DocumentDB's gateway and PostgreSQL extensions fit together? / Does installing only the extension expose a MongoDB endpoint? / Should I use DocumentDB or PostgreSQL JSONB? / How do I find the actual DocumentDB engine version? | +| AI and agents | Create a vector index and retrieve stored context. / What are DocumentDB's filtered vector search limitations? / How can a coding agent use DocumentDB locally? / How do I add persistent MCP memory with DocumentDB? | + +Save evaluation results outside the published site, compare a small changed-page cohort with unchanged pages, and repeat before expanding content. Private search-console data, referral analytics and verified crawler logs can supplement these observations; the static site does not collect model citation or task-success measurements automatically. + ## Prerequisites for Development - **[Node.js](https://nodejs.org/)** (*20 or higher*) diff --git a/scripts/generate-sitemap.mjs b/scripts/generate-sitemap.mjs index 934d59b..9bb8ec6 100644 --- a/scripts/generate-sitemap.mjs +++ b/scripts/generate-sitemap.mjs @@ -70,6 +70,21 @@ function xmlEscape(value) { .replace(/'/g, '''); } +function contentModifiedTime(html) { + for (const tag of html.match(/]*>/gi) ?? []) { + if (!/\bproperty=["']article:modified_time["']/i.test(tag)) continue; + const value = tag.match(/\bcontent=["']([^"']+)["']/i)?.[1]; + if (!value || !/^\d{4}-\d{2}-\d{2}(?:T.*)?$/.test(value)) continue; + const date = new Date(value); + const day = value.slice(0, 10); + if (Number.isFinite(date.getTime()) && new Date(`${day}T00:00:00Z`).toISOString().slice(0, 10) === day) { + return date.toISOString(); + } + } + // Missing provenance is preferable to a deploy timestamp masquerading as a content update. + return undefined; +} + /** * Walks the export directory and returns one entry per page, where a page is * any directory containing an index.html (the shape `trailingSlash: true` and @@ -88,7 +103,7 @@ function collectPages(directory, relativePath = '') { } else { pages.push({ url: relativePath === '' ? '/' : `/${relativePath}/`, - lastModified: fs.statSync(indexFile).mtime, + lastModified: contentModifiedTime(html), }); } } @@ -142,7 +157,7 @@ const sitemap = [ [ ' ', ` ${xmlEscape(siteUrl + page.url)}`, - ` ${page.lastModified.toISOString()}`, + ...(page.lastModified ? [` ${page.lastModified}`] : []), ' ', ].join('\n'), ), diff --git a/tests/blogSections.test.ts b/tests/blogSections.test.ts index a07a170..07ee586 100644 --- a/tests/blogSections.test.ts +++ b/tests/blogSections.test.ts @@ -211,9 +211,27 @@ describe.each([ expect(html).toContain(`← Back to all ${backLabel}`); expect(html).toContain(``); expect(html).toContain(``); + const json = html.match(/'; + const data = articleStructuredData({ + title, + path: "/docs/example/", + breadcrumbs: [{ name: title, path: "/docs/example/" }], + }); + const html = renderToStaticMarkup(createElement(StructuredData, { data })); + expect(html).not.toContain("/g)).toHaveLength(1); + expect(structuredData(html)["@graph"][0].headline).toBe(title); + }); + + it.each(["2026-02-30", "not a date", 123, undefined])("omits untrustworthy modification date %s", (value) => { + expect(getModifiedTime(value)).toBeUndefined(); + }); + + it("preserves valid content timestamps with timezone offsets", () => { + expect(getModifiedTime("2026-11-18T23:30:00-08:00")).toBe("2026-11-19T07:30:00.000Z"); + }); + +}); diff --git a/tests/sitemapDiscovery.test.ts b/tests/sitemapDiscovery.test.ts index fb422da..aabfa88 100644 --- a/tests/sitemapDiscovery.test.ts +++ b/tests/sitemapDiscovery.test.ts @@ -34,4 +34,27 @@ describe('operator sitemap discovery', () => { expect(await readFile(path.join(out, 'robots.txt'), 'utf8')).toBe(robots); expect(await readFile(path.join(out, 'sitemap.xml'), 'utf8')).toContain('https://documentdb.io/'); }); + + it('uses explicit content dates, not exported HTML timestamps, and excludes placeholders', async () => { + const directory = await mkdtemp(path.join(tmpdir(), 'documentdb-sitemap-dates-')); + directories.push(directory); + const out = path.join(directory, 'out'); + const pages = { + '': 'No content date', + dated: '', + invalid: '', + placeholder: '', + }; + for (const [slug, html] of Object.entries(pages)) { + const target = path.join(out, slug); + await mkdir(target, { recursive: true }); + await writeFile(path.join(target, 'index.html'), html); + } + execFileSync(process.execPath, [generator], { cwd: directory }); + const sitemap = await readFile(path.join(out, 'sitemap.xml'), 'utf8'); + expect(sitemap.match(//g)).toHaveLength(1); + expect(sitemap).toContain('2026-11-18T00:00:00.000Z'); + expect(sitemap).not.toContain('/placeholder/'); + expect(sitemap).toContain('/invalid/'); + }); }); From e65cee5cad0ccf0c4e06808fc34bbc6e2f0b3705 Mon Sep 17 00:00:00 2001 From: Lei Jiang Date: Thu, 19 Nov 2026 10:30:35 -0800 Subject: [PATCH 7/9] Fix pipeline errors --- .github/workflows/continuous-deployment.yml | 4 +-- .github/workflows/continuous-integration.yml | 4 +-- readme.md | 9 +++++++ tests/discoveryContent.test.tsx | 26 +++++++++++++++++++- 4 files changed, 38 insertions(+), 5 deletions(-) diff --git a/.github/workflows/continuous-deployment.yml b/.github/workflows/continuous-deployment.yml index b046b23..fa2cada 100644 --- a/.github/workflows/continuous-deployment.yml +++ b/.github/workflows/continuous-deployment.yml @@ -184,8 +184,8 @@ jobs: GH_TOKEN: ${{ github.token }} run: | set -euo pipefail - .github/scripts/download_packages.sh - SUITE=latest DOCUMENTDB_VERSION="$DOCUMENTDB_LATEST_VERSION" .github/scripts/download_packages.sh + bash .github/scripts/download_packages.sh + SUITE=latest DOCUMENTDB_VERSION="$DOCUMENTDB_LATEST_VERSION" bash .github/scripts/download_packages.sh - name: Verify generated package components if: steps.features.outputs.packages == 'true' env: diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index b3941e4..4cfcad4 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -102,9 +102,9 @@ jobs: GH_TOKEN: ${{ github.token }} run: | set -euo pipefail - .github/scripts/download_packages.sh + bash .github/scripts/download_packages.sh # Unpinned, like the deploy while DOCUMENTDB_LATEST_VERSION is unset. - SUITE=latest DOCUMENTDB_VERSION=latest .github/scripts/download_packages.sh + SUITE=latest DOCUMENTDB_VERSION=latest bash .github/scripts/download_packages.sh - name: Verify release inventory and metadata run: python3 .github/scripts/verify_package_inventory.py - name: Resolve both PostgreSQL majors and retired endpoints diff --git a/readme.md b/readme.md index 4ec1f8b..63b2586 100644 --- a/readme.md +++ b/readme.md @@ -75,6 +75,15 @@ The first time you run `npm run dev` or `npm run build`, documentation content w We welcome contributions to improve the DocumentDB website, whether it's blog posts, bug fixes, or enhancements to the site itself. +### Running checks + +```bash +npm run lint +npm test +``` + +CI runs tests before compiling upstream documentation. Use self-contained fixtures for imported-content tests rather than depending on the generated `articles/` or `reference/` trees, which are absent on a fresh checkout. + ### Contributing Announcements and Blog Posts Announcements and blog posts are managed locally in this repository. Contribute directly through a pull request to this repository. diff --git a/tests/discoveryContent.test.tsx b/tests/discoveryContent.test.tsx index 815bccd..0f74d0f 100644 --- a/tests/discoveryContent.test.tsx +++ b/tests/discoveryContent.test.tsx @@ -1,3 +1,5 @@ +import fs from "node:fs"; +import path from "node:path"; import { createElement } from "react"; import { renderToStaticMarkup } from "react-dom/server"; import matter from "gray-matter"; @@ -36,7 +38,29 @@ describe("static discovery content", () => { }); it("preserves upstream architecture content", () => { - const source = matter(articles.getMarkdownContent("architecture")); + const markdown = `--- +title: Upstream architecture +description: Architecture documentation from upstream. +layout: coming-soon +--- + +Architecture details will be published here. +`; + const directory = path.join(process.cwd(), "articles", "architecture"); + const files = new Map([ + [path.join(directory, "index.md"), markdown], + [path.join(directory, "navigation.yml"), "- title: Architecture\n link: index.md\n"], + ]); + const existsSync = fs.existsSync; + const readFileSync = fs.readFileSync; + vi.spyOn(fs, "existsSync").mockImplementation((file) => + files.has(file.toString()) || existsSync(file), + ); + vi.spyOn(fs, "readFileSync").mockImplementation((file, options) => + files.get(file.toString()) ?? readFileSync(file, options), + ); + + const source = matter(markdown); const architecture = articles.getArticleByPath("architecture"); expect(architecture?.content).toBe(source.content); expect(architecture?.frontmatter).toEqual(source.data); From a6a2a64dc0715201194d3076a02a8c3e84c7a152 Mon Sep 17 00:00:00 2001 From: Lei Jiang Date: Fri, 20 Nov 2026 10:28:07 -0800 Subject: [PATCH 8/9] Why document db article --- app/why-document-databases/page.tsx | 77 +++++++ blogs/_data/nav.json | 1 + content/why-document-databases.md | 305 ++++++++++++++++++++++++++++ tests/discoveryContent.test.tsx | 22 ++ 4 files changed, 405 insertions(+) create mode 100644 app/why-document-databases/page.tsx create mode 100644 content/why-document-databases.md diff --git a/app/why-document-databases/page.tsx b/app/why-document-databases/page.tsx new file mode 100644 index 0000000..501489b --- /dev/null +++ b/app/why-document-databases/page.tsx @@ -0,0 +1,77 @@ +import fs from "node:fs"; +import path from "node:path"; +import Link from "next/link"; +import Markdown from "../components/Markdown"; +import StructuredData, { articleStructuredData } from "../components/StructuredData"; +import { headingAnchor } from "../lib/docsAnchors"; +import { getMetadata } from "../services/metadataService"; + +const pagePath = "/why-document-databases/"; +const description = + "Understand when document databases fit, how open-source DocumentDB builds on PostgreSQL, and how APIs, licensing, and hosting shape your choices."; + +export const metadata = getMetadata({ + title: "Why Document Databases? - DocumentDB", + description, + path: pagePath, + type: "article", +}); + +export default function WhyDocumentDatabasesPage() { + const sourcePath = "content/why-document-databases.md"; + const content = fs.readFileSync(path.join(process.cwd(), sourcePath), "utf8"); + const title = content.match(/^# (.+)$/m)![1]; + const sections = [...content.matchAll(/^## (.+)$/gm)].map((match) => match[1]); + + return ( +
+ + +
+ ); +} diff --git a/blogs/_data/nav.json b/blogs/_data/nav.json index 72c2d19..8cfe72b 100644 --- a/blogs/_data/nav.json +++ b/blogs/_data/nav.json @@ -1,5 +1,6 @@ { "links": [ + { "label": "Why documents?", "href": "/why-document-databases" }, { "label": "Docs", "href": "/docs" }, { "label": "Install & Download", "href": "/packages" }, { "label": "AI", "href": "/ai" }, diff --git a/content/why-document-databases.md b/content/why-document-databases.md new file mode 100644 index 0000000..3bab529 --- /dev/null +++ b/content/why-document-databases.md @@ -0,0 +1,305 @@ +# Why are there many document databases now? A Perspective from an open-source DocumentDB + +Modern applications often work with documents before they work with databases. A customer profile arrives as JSON. A product has nested attributes. A content item combines text, tags, permissions, and references to media. An AI application associates those records with embeddings. + +Document databases let developers persist and query data in a form close to these application objects. Their appeal is not simply that they avoid tables. It is that, for suitable workloads, they reduce the distance between how an application represents information and how its database stores and retrieves it. + +**MongoDB deserves recognition as a trailblazer in bringing this approach to mainstream application development.** It did not invent document databases, but helped popularize a compelling combination: flexible JSON-like documents, collections, document-oriented queries and updates, and drivers that make those operations accessible from application code. Its [document model and query capabilities](https://www.mongodb.com/docs/manual/) remain a foundational reference point for implementations supporting MongoDB APIs. + +That influence goes beyond storing documents. Developers have invested in MongoDB APIs, tools, frameworks, and expertise. Compatible implementations can preserve part of that investment while offering different engines, operating models, or licensing terms. Compatibility is therefore a useful bridge, not the entire reason to build another document database. + +But the document model does not dictate a single database engine, license, or hosting provider. That helps explain why there are multiple document databases: organizations want similar development experiences with different choices about infrastructure, operations, compatibility, and ownership. + +The open-source [DocumentDB project](https://github.com/documentdb/documentdb) illustrates one approach: implement selected MongoDB wire-protocol commands and support compatible drivers, using PostgreSQL as the underlying engine, and distribute the project under the MIT License. The opportunity is to make that familiar development model available through a permissively licensed implementation that organizations can inspect, operate, and extend -- adding choices rather than dismissing MongoDB's contribution. + +*A naming distinction matters: open-source DocumentDB, Amazon DocumentDB, and Azure DocumentDB are not interchangeable names for one product. Amazon DocumentDB is an AWS managed service. Azure DocumentDB describes itself as a managed service built on the open-source DocumentDB foundation. Shared terminology and MongoDB compatibility do not establish identical implementations or feature sets.* + +## Why choose a document database? + +A document database stores records as documents containing fields, nested objects, and arrays. Documents within a collection can have different attributes. + +Consider a product catalog: + +```json +{ + "_id": "camera-104", + "category": "camera", + "name": "Compact travel camera", + "specifications": { + "resolutionMegapixels": 24, + "weatherSealed": true + }, + "tags": ["travel", "photography"] +} +``` + +A book in the same catalog might have an author and ISBN rather than camera specifications. A document model accommodates these differences without requiring a column for every possible attribute or a separate table for every product category. + +The practical advantages are conditional, but meaningful: + +- **Evolving attributes:** adding an optional document field can avoid a database-wide table-schema change. +- **Nested application objects:** related information frequently read together can be stored together. +- **Heterogeneous records:** different record types can retain their relevant attributes without populating a large set of irrelevant columns. +- **Document-oriented queries:** applications can filter fields, project selected values, and aggregate documents through an API suited to their data model. + +None of this means "no schema." Applications still need agreements about field names, types, required values, and versioning. Flexible storage moves some schema decisions out of table definitions; it does not remove the need for data discipline. + +Nor are these capabilities exclusive to dedicated document databases. PostgreSQL has [native JSON and JSONB types, document-processing operators, and JSONB indexing](https://www.postgresql.org/docs/current/datatype-json.html). Applications that prefer SQL can already combine relational and document-shaped data without adopting a separate document API. + +That native support should not be confused with MongoDB compatibility. PostgreSQL's JSONB is not BSON, and PostgreSQL does not natively expose the MongoDB wire protocol. DocumentDB adds BSON support through an extension, together with collection management, document operations, indexing behavior, and a gateway implementing selected MongoDB wire-protocol commands. Its additional value is this document-database interface and implementation -- not merely the ability to store JSON. + +## A broad category, with different interfaces and deployment choices + +As [an overview of document-oriented databases](https://en.wikipedia.org/wiki/Document-oriented_database), it describes a broad category, not a common application interface. MongoDB, Azure Cosmos DB, Amazon DynamoDB, Apache CouchDB, and Couchbase all support document-shaped data, but that does not make their clients, queries, or deployment models interchangeable. + +These products compete on developer interfaces, workload capabilities, operational services, and ownership. **MongoDB API compatibility connects some of them to an established application ecosystem; portability is a possible benefit, not the defining feature of document databases.** A database can be document-oriented without accepting MongoDB commands. Conversely, a service can accept MongoDB commands without making its underlying engine available for self-hosting. + +### Similar documents do not imply compatible applications + +| Database or API | Document-oriented capabilities and interface | What changes when moving a MongoDB application? | +|---|---|---| +| **Amazon DynamoDB** | Flexible items with nested attributes, accessed through DynamoDB operations and AWS SDKs. | Database calls and access patterns generally need adaptation; storing nested data is not MongoDB protocol compatibility. | +| **Azure Cosmos DB for NoSQL** | Flexible document storage through Cosmos DB APIs and SDKs, with its own partitioning, consistency, and throughput model. | MongoDB calls must be replaced or translated, and database-specific behavior must be reconsidered. | +| **Azure Cosmos DB for MongoDB** | A separate Cosmos DB API supporting the MongoDB wire protocol and existing MongoDB drivers. | Some client code can be retained, but supported operations and service semantics still need testing. | +| **Apache CouchDB** | Documents exposed through a RESTful HTTP API, with document revisions and optimistic conflict handling. | HTTP operations and revision handling are not substitutes for MongoDB commands; application adaptation is required. | +| **Couchbase** | JSON documents queried with SQL++, alongside its other data-access interfaces. | SQL++ queries are not MongoDB aggregation pipelines; application queries and database calls need adaptation. | + +These distinctions are grounded in the products' own documentation. [DynamoDB's data model](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/HowItWorks.CoreComponents.html) permits varying attributes and nested documents, while its [`Query` operation](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Query.html) requires a specific partition-key value, optionally refined by a sort-key condition. Secondary indexes provide additional access paths. This encourages deliberate key and access-pattern design rather than treating every document field as an interchangeable query entry point. + +[Cosmos DB](https://learn.microsoft.com/en-us/azure/cosmos-db/overview) combines document storage with managed global distribution and other data models. Crucially, **"Cosmos DB" alone is not precise enough for a compatibility comparison**: [Cosmos DB for MongoDB](https://learn.microsoft.com/en-us/azure/cosmos-db/mongodb/overview) explicitly supports the MongoDB wire protocol. It belongs in MongoDB comparisons too. Microsoft currently directs readers considering MongoDB migrations or MongoDB Query Language features toward Azure DocumentDB, while retaining Cosmos DB for MongoDB as a distinct offering. + +[CouchDB's HTTP interface](https://docs.couchdb.org/en/stable/intro/overview.html) and [Couchbase's SQL++ queries](https://docs.couchbase.com/server/current/n1ql/n1ql-intro/queriesandresults.html) illustrate why document storage alone does not establish a shared API. They are alternatives in the broader database-selection discussion, even when they are not direct substitutes for an existing MongoDB application. + +### What does "portable" actually mean? + +Portability has several independent dimensions: + +- **Data portability:** can records be exported and imported while preserving identifiers, numeric types, dates, and other values? JSON export alone may lose distinctions represented in BSON or other typed formats. +- **Application portability:** can drivers, commands, queries, and transaction behavior be retained? A shared wire protocol reduces rewriting, but does not guarantee matching results or supported features. +- **Deployment portability:** can a production-capable implementation run on-premises or with a different infrastructure provider? +- **Operational portability:** can backup, recovery, authentication, monitoring, and provisioning workflows move too? Those often remain specific to an engine or cloud service. + +For example, Amazon DocumentDB improves application portability for supported MongoDB workloads, but its managed service is an AWS offering, not a self-hostable distribution of the open-source DocumentDB engine. Its [supported-API matrix](https://docs.aws.amazon.com/documentdb/latest/devguide/mongo-apis.html) and functional-difference documentation matter more than the shared product name. + +Open-source DocumentDB adds a different dimension: the implementation is available to operate and modify on infrastructure an organization controls. That expands deployment choice, but does not make PostgreSQL data files interchangeable with MongoDB's, or eliminate migration and compatibility testing. + +Local development also should not be confused with production deployment freedom. The [Cosmos DB emulator](https://learn.microsoft.com/en-us/azure/cosmos-db/emulator) is intended for development, not production. [DynamoDB Local](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/DynamoDBLocal.html) supports offline development and testing. AWS now also documents [ExtendDB](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/ExtendDB.html), an independent open-source DynamoDB-compatible adapter using backends such as SQLite or PostgreSQL. This is an important counterexample to a blanket claim that DynamoDB APIs cannot be implemented outside AWS; however, AWS describes the documented development image as local/CI-only, not suitable for production or shared networks. + +### Narrowing the comparison to implementations supporting MongoDB APIs + +For teams that specifically want to preserve MongoDB drivers and document operations, the relevant comparison includes **open-source DocumentDB, Amazon DocumentDB, Azure DocumentDB, and Cosmos DB for MongoDB**, alongside MongoDB itself. + +MongoDB itself also offers deployment choices. [MongoDB Atlas supports AWS, Azure, and Google Cloud](https://www.mongodb.com/docs/atlas/reference/cloud-providers/), demonstrating that multicloud hosting is not exclusive to open-source DocumentDB. Choosing a cloud provider within one managed product, switching database implementations, and obtaining permissive rights to operate or redistribute an engine are nevertheless different freedoms. + +The practical conclusion is not that broader document databases are unsuitable. DynamoDB or Cosmos DB may be a strong fit when their access models and managed capabilities match the application. **Choose the document model for the data, the API for the application, and the deployment and license for the organization's portability requirements.** + +## What makes open-source DocumentDB a database, rather than a JSON storage wrapper? + +The implementation provides a useful way to evaluate the claims. + +At a high level, its architecture is: + +```text +Application using a MongoDB driver + | + MongoDB wire protocol + | + DocumentDB Rust gateway + | + PostgreSQL queries and DocumentDB functions + | + BSON types, document operations, and indexes + | + PostgreSQL +``` + +### BSON is a native PostgreSQL type + +DocumentDB uses BSON, a binary document format that supports nested structures and typed values beyond plain JSON, including binary data and additional numeric and identifier types. + +The core extension [registers a PostgreSQL BSON type](https://github.com/documentdb/documentdb/blob/a5f1636269e5062fa22a24bfa4d58d3cc92a0bc7/pg_documentdb_core/sql/types/bson--0.10-0.sql), with text and binary input/output functions. The document representation is therefore integrated into PostgreSQL's type system, rather than stored only as application-managed text. + +The collection-creation code supplies another concrete detail: [it creates PostgreSQL tables](https://github.com/documentdb/documentdb/blob/a5f1636269e5062fa22a24bfa4d58d3cc92a0bc7/pg_documentdb/src/commands/create_collection_core.c#L319-L369) containing a BSON `document` column and a separate BSON `object_id` column. + +This explains how flexible documents and relational storage coexist. The physical table has a defined structure; the document inside a row can carry varying fields. + +### Familiar drivers connect to a document-aware backend + +The Rust gateway parses MongoDB wire-protocol messages and translates operations into PostgreSQL calls. Its [query catalog](https://github.com/documentdb/documentdb/blob/a5f1636269e5062fa22a24bfa4d58d3cc92a0bc7/pg_documentdb_gw/documentdb_gateway_core/src/postgres/query_catalog.rs#L674-L683) includes calls for inserting, finding, updating, deleting, and aggregating documents. + +The benefit is a familiar application interface without requiring the storage engine itself to be MongoDB. The project's quickstart, for example, connects using PyMongo. + +However, **support for MongoDB drivers and selected commands does not mean identical behavior to every MongoDB version or feature**. Applications should test their actual commands, query semantics, transaction requirements, and driver behavior before migrating. + +The gateway is also not a REST API. A browser-facing HTTP application normally needs an application service that handles authentication, business logic, and database access. + +### Documents can be queried and indexed -- not just retrieved whole + +The [aggregation implementation](https://github.com/documentdb/documentdb/blob/a5f1636269e5062fa22a24bfa4d58d3cc92a0bc7/pg_documentdb/src/aggregation/bson_aggregation_pipeline.c) generates backend queries for document pipelines, including stages such as `$match`, `$project`, and `$group`. + +Document indexes are integrated with PostgreSQL access methods. The [index-handler selection code](https://github.com/documentdb/documentdb/blob/a5f1636269e5062fa22a24bfa4d58d3cc92a0bc7/pg_documentdb/src/commands/create_indexes.c#L699-L734), for example, selects a RUM-based handler by default and checks whether an alternative handler supports the requested index capabilities. + +The architectural advantage is that document queries can use database execution and indexing machinery rather than requiring an application to fetch every record and inspect it. + +This is not a universal performance claim. Query selectivity, index choice, document size, update frequency, and supported optimizations still determine results. Indexes also consume storage and add write overhead. + +### Flexibility can coexist with validation + +The [schema-validation implementation](https://github.com/documentdb/documentdb/blob/a5f1636269e5062fa22a24bfa4d58d3cc92a0bc7/pg_documentdb/src/schema_validation/schema_validation.c#L28-L103) checks updated documents against configured validators and distinguishes validation behavior for different modes. + +That matters for evolving applications: teams can allow optional attributes while still enforcing important invariants. Availability and behavior should be checked against the deployed release and configuration; the code includes a feature gate. + +### Vector search builds on PostgreSQL extensions + +For AI-oriented applications, the source includes definitions for [IVFFlat and HNSW vector indexes](https://github.com/documentdb/documentdb/blob/a5f1636269e5062fa22a24bfa4d58d3cc92a0bc7/pg_documentdb/src/vector/vector_index_kind_impl.c#L108-L130). It also [generates index expressions](https://github.com/documentdb/documentdb/blob/a5f1636269e5062fa22a24bfa4d58d3cc92a0bc7/pg_documentdb/src/vector/vector_utilities.c#L145-L220) that extract document vectors and use PostgreSQL vector types and distance operator classes. + +This can bring document content, metadata, and similarity search into one database system. It does not eliminate the need to generate embeddings, enforce access controls, or evaluate retrieval quality. + +These source references demonstrate implementation mechanisms in the inspected revision -- not a promise that every capability is enabled in every packaged release or managed service. + +## Which applications benefit most? + +AWS's [document-database use cases](https://docs.aws.amazon.com/documentdb/latest/devguide/document-database-use-cases.html) identify user profiles, operational data, and content management. These are useful starting points because their suitability follows from the shape and access patterns of the data. + +| Application | Why documents can fit | Important design boundary | +|---|---|---| +| **User profiles and preferences** | Users supply different optional attributes; settings often form nested objects read together. | Keep frequently updated or unbounded activity histories separate from the profile. | +| **Product catalogs** | Categories have different specifications, while applications share common search fields. | Standardize the fields used for filtering, sorting, and validation. | +| **Content management** | Articles, comments, and other content types combine common metadata with type-specific fields. | Large images and videos are often better kept in object storage, with references in documents. | +| **Operational events and telemetry** | Sources produce evolving payloads that can be filtered and aggregated near ingestion. | Retention, ingestion throughput, and analytical query costs still need explicit planning. | +| **AI knowledge applications** | Content, provenance, metadata, and embeddings can be associated with the same records. | Retrieval quality, authorization, and model integration remain application responsibilities. | + +The strongest fit is often an **application aggregate**: a bounded object whose information belongs together and is commonly retrieved together. + +A document model is less compelling when the workload depends on extensive joins, shared entities that must be updated consistently across many records, or database-enforced relationships. Relational tables may be clearer for accounting, inventory invariants, and highly interconnected transactional data. + +Embedding can reduce joins for suitable reads, but excessive embedding can create oversized documents, duplicated information, and expensive updates. The right question is not "Are documents better than tables?" It is "Which representation best matches this application's consistency and access requirements?" + +## Why PostgreSQL underneath matters + +Building on PostgreSQL separates two decisions that are often bundled together: the application's document interface and the underlying database engine. + +DocumentDB can use PostgreSQL's storage, transaction, query-execution, and extension infrastructure while adding document-specific behavior. For organizations already familiar with PostgreSQL, this offers a recognizable foundation for operations and troubleshooting. + +It also creates an opportunity to reuse existing database expertise rather than introduce an entirely unfamiliar engine. PostgreSQL's extension ecosystem is visible in the vector-search implementation, for example. + +There are limits to that benefit. Existing PostgreSQL tooling must be validated with DocumentDB's extensions, metadata, and gateway. Backup restoration must recover a working DocumentDB system, not merely produce a successful PostgreSQL restore command. + +Likewise, PostgreSQL underneath does not automatically guarantee complete MongoDB transaction semantics, effortless horizontal scaling, or managed-service availability. Those depend on the DocumentDB implementation and deployment architecture. + +**The advantage is a mature foundation -- not exemption from database engineering.** + +## Why the MIT License matters -- and where SSPL changes the calculation + +The project's [MIT License](https://github.com/documentdb/documentdb/blob/a5f1636269e5062fa22a24bfa4d58d3cc92a0bc7/LICENSE) permits using, modifying, distributing, sublicensing, and selling the software, subject to preserving the required copyright and permission notices. + +For an organization building applications, this provides considerable freedom to: + +- Operate the database on its own infrastructure. +- Package it with a commercial product. +- Modify the implementation for specific requirements. +- Build hosting or support services around it. + +The MIT License does not impose a requirement to publish the surrounding application or hosting stack merely because the database is offered as a service. Dependencies have their own licenses, however, and should be reviewed separately. + +That differs materially from the **Server Side Public License (SSPL)**: [Section 13 of the SSPL](https://www.mongodb.com/legal/licensing/server-side-public-license) requires that, when the program's functionality is offered to third parties as a service, the defined "Service Source Code" be made available to everyone by network download at no charge under the SSPL. Its definition includes software used to provide the service, such as management, monitoring, backup, and hosting software. + +This is especially relevant to database-hosting businesses and products that expose database functionality. It should **not** be reduced to the claim that every application using an SSPL database must publish all its code. The applicable obligations depend on what is being offered and how; legal review is appropriate for a specific business model. + +The [Open Source Initiative does not recognize SSPL as an open-source license](https://opensource.org/blog/the-sspl-is-not-an-open-source-license). Publicly readable source and permissively licensed open source are different propositions. + +MIT licensing reduces this particular licensing friction. It does not supply a warranty, pay infrastructure bills, or remove operational responsibilities. + +## The opportunity: organizations can own their database-backed applications + +The broader vision, and like the reality, is not that every organization should create a new database engine. It is that organizations should be able to adopt, inspect, operate, and -- when necessary -- adapt the database on which their applications depend. + +An open, permissively licensed implementation of a familiar document interface can broaden participation: application teams gain deployment choices, software vendors can serve customer-hosted environments, and contributors and service providers can build on a shared foundation. Those benefits can extend beyond the users of any one hosting service. This builds on the developer experience MongoDB helped establish, while using PostgreSQL's database infrastructure rather than requiring every project to create a storage engine from scratch. + +An open-source document database makes that practical without requiring an immediate commitment to a particular managed service. A team can begin locally, validate its data model, test its real queries, and understand the implementation before deciding where production should run. + +That can suit customer-hosted software, on-premises deployments, private environments, and teams with established PostgreSQL operations. + +Ownership is not the same as isolation from the cloud. The same application may use cloud compute, object storage, identity, and monitoring while retaining a self-operated database. Alternatively, the team may conclude that managed database operations provide better value. + +Either way, the starting point can be an application requirement rather than a hosting commitment. + +## When cloud hosting or database-as-a-service is the better choice + +Self-hosting is not automatically cheaper or safer. Operating a production database requires patching, capacity planning, access management, monitoring, backup verification, incident response, and recovery exercises. + +Managed services become particularly valuable in these scenarios: + +| Scenario | Why managed hosting can help | +|---|---| +| **A small team needs production reliability** | Database maintenance and on-call work would otherwise compete with application development. | +| **Availability and recovery objectives are demanding** | Managed failover, backups, and recovery capabilities can reduce implementation and operational effort. | +| **Capacity changes significantly** | Provider-supported scaling can simplify provisioning, subject to service limits and pricing. | +| **Enterprise controls must integrate with cloud infrastructure** | Private networking, encryption-key management, monitoring, and governance may be easier to standardize. | +| **The application is part of a broader cloud solution** | Database operations can be integrated with application hosting, identity, event processing, storage, analytics, and AI services. | + +[Amazon DocumentDB](https://docs.aws.amazon.com/documentdb/latest/devguide/what-is.html) provides a fully managed service supporting selected MongoDB APIs and drivers. Its documentation describes automated backups and point-in-time recovery, replica-based failover, VPC isolation, and encryption integrated with AWS KMS. + +[Azure DocumentDB](https://azure.microsoft.com/en-us/products/documentdb) describes an open-source-based managed document database with high-availability options, backups, scaling, and Azure integrations for security, monitoring, application hosting, and AI. + +Neither service should be selected by name or compatibility status alone. Evaluate supported operations, regional availability, recovery objectives, workload performance, migration effort, and total cost. Managed-service features are not automatically capabilities of a standalone open-source deployment. + +### Cloud-provider services versus specialist database vendors + +Azure DocumentDB and Amazon DocumentDB are not the only managed choices. Specialist database vendors also operate services on public clouds. Examples include MongoDB Atlas and Couchbase Capella; "specialist" here describes their database-centered offerings, not an absence of cloud integrations. + +| Service | Distinctive consideration | What to evaluate | +|---|---|---| +| **Azure DocumentDB** | An Azure-managed service built on the open-source DocumentDB foundation, with Azure resource management and identity integration. | Supported application behavior, service-tier capabilities, and how closely the managed deployment matches a self-operated deployment. | +| **Amazon DocumentDB** | An AWS-managed database supporting selected MongoDB APIs, integrated with AWS infrastructure and services. | Supported commands and semantics, cluster-specific capabilities, and fit with existing AWS operations. | +| **MongoDB Atlas** | A managed offering from the vendor developing MongoDB, available on AWS, Azure, and Google Cloud. | Required MongoDB features, deployment options, cloud integrations, and total cost. | +| **Couchbase Capella** | A managed document database with SQL++ querying, search, eventing, and mobile/edge synchronization options. | Whether those capabilities fit the application better than retaining MongoDB APIs, and the cost of changing application interfaces. | + +The [Atlas cloud-provider documentation](https://www.mongodb.com/docs/atlas/reference/cloud-providers/) establishes its hosting choices. [Capella's documentation](https://docs.couchbase.com/cloud/get-started/intro.html) describes its database, search, eventing, and mobile capabilities, while its [cluster-creation guide](https://docs.couchbase.com/cloud/clusters/create-database.html) documents cloud-provider selection and private-networking options. + +**Managed backups, scaling, and private networking are not exclusive advantages of a cloud provider's own database service.** The more useful comparison is how much work remains to integrate each service into the organization's operating environment, and whether its database capabilities meet the workload. + +### What does the surrounding cloud ecosystem actually buy? + +The benefit is usually less integration and operational work across the complete application, not an automatic improvement in document-query performance. + +**Shared identity and governance.** A database that fits existing identity and resource-management practices can reduce separate credential systems and administrative workflows. Azure DocumentDB supports [Microsoft Entra ID authentication, including managed identities](https://learn.microsoft.com/en-us/azure/documentdb/how-to-connect-role-based-access-control). Amazon DocumentDB exposes [resource-management permissions through AWS IAM](https://docs.aws.amazon.com/documentdb/latest/devguide/security-iam.html). Resource administration and permission to read or write database records are different layers; one must not be mistaken for the other. + +**Private application-to-database connectivity.** Using private network paths can avoid exposing a database endpoint publicly and align connectivity with existing network controls. Azure DocumentDB documents [Private Link connectivity](https://learn.microsoft.com/en-us/azure/documentdb/how-to-private-link), while Amazon DocumentDB runs within a VPC. This is not an exclusive cloud-provider advantage: [Atlas supports private endpoints](https://www.mongodb.com/docs/atlas/security-private-endpoint/) through AWS PrivateLink, Azure Private Link, and Google Cloud Private Service Connect on supported deployments. Network proximity can help latency and transfer costs, but depends on region, routing, and pricing -- not on the database vendor's name. + +**A common monitoring workflow.** Integrating database diagnostics with an existing operations platform can simplify alert routing and incident investigation. Azure DocumentDB can send [diagnostic logs to Azure Monitor and Log Analytics](https://learn.microsoft.com/en-us/azure/documentdb/how-to-monitor-diagnostics-logs), allowing operators to investigate database requests within their Azure monitoring environment. This requires configuration, and the documented resource-log feature excludes some lower tiers. Integration does not automatically provide end-to-end application tracing. + +**Managed event-processing connections.** A documented service integration can replace some custom plumbing. For example, [AWS Lambda can process Amazon DocumentDB change streams](https://docs.aws.amazon.com/lambda/latest/dg/with-documentdb.html) through an event-source mapping, supporting workflows such as updating a search index when records change. The integration has engine-version and cluster-type restrictions, and delivery is at least once, so application handlers must tolerate duplicate events. "Integrated" does not mean unrestricted or exactly once. + +**A smaller procurement and support coordination burden.** Where an organization already standardizes on a cloud provider, its database service may fit existing purchasing, resource inventories, cost allocation, and support processes. That can be valuable even without a unique database feature. However, contractual coverage, support plans, marketplace purchasing, and charges must be checked; specialist vendors may fit those processes too. + +Specialist services can offer many of the same connections. For example, [Atlas supports AWS IAM database authentication](https://www.mongodb.com/docs/atlas/security/aws-iam-authentication/), including roles used by applications on AWS compute. It would therefore be misleading to frame this choice as "cloud integration versus no integration." + +The tradeoff is between **database-specific strengths, integration effort, and platform dependence**. Cloud-native identities, event mappings, and operational APIs can reduce work today while making a later move more involved. A specialist service may preserve one database interface across multiple clouds, but still introduces dependencies on its own management platform. Neither model eliminates lock-in or guarantees lower cost. + +For a team already operating its application in Azure or AWS, an integrated database service can be the simplest complete solution. For a team prioritizing particular database features, mobile synchronization, or a consistent managed offering across clouds, a specialist vendor may be a better fit. For organizations requiring customer-hosted deployments or direct control of the engine, open-source DocumentDB remains another starting point. + +The final architecture is usually larger than the database: + +```text +Web, mobile, or AI client + | +Application service / HTTP API + | + Document database + | +Identity, monitoring, backups, object storage, +event processing, and cloud AI or analytics +``` + +The database is a component of that system, not a replacement for it. + +## Start with the application, keep deployment choices open + +There are many document databases because the document model solves a recurring application problem, while organizations have different requirements for implementation, licensing, and operations. + +Open-source DocumentDB offers a concrete combination: a document-oriented interface, BSON and document operations integrated with PostgreSQL, and a permissive MIT License. Its value is not that it makes every workload faster or every deployment simpler. Its value is that teams can adopt the document model while retaining meaningful control over the software and infrastructure. + +A sensible starting point is the [open-source quickstart](https://github.com/documentdb/documentdb#get-started): build a representative application, test compatibility, measure real queries, and verify backup and recovery procedures. Then choose self-hosting or a managed service according to production requirements. + +**Choose documents because they fit the application. Choose hosting because it fits the organization.** diff --git a/tests/discoveryContent.test.tsx b/tests/discoveryContent.test.tsx index 0f74d0f..e4eec77 100644 --- a/tests/discoveryContent.test.tsx +++ b/tests/discoveryContent.test.tsx @@ -5,6 +5,7 @@ import { renderToStaticMarkup } from "react-dom/server"; import matter from "gray-matter"; import { afterEach, describe, expect, it, vi } from "vitest"; import PackagesPage from "../app/packages/page"; +import WhyDocumentDatabasesPage, { metadata as whyDocumentsMetadata } from "../app/why-document-databases/page"; import ArticlePage, { generateMetadata } from "../app/docs/[section]/[[...slug]]/page"; import StructuredData, { articleStructuredData } from "../app/components/StructuredData"; import { getModifiedTime } from "../app/services/metadataService"; @@ -24,6 +25,27 @@ function structuredData(html: string) { } describe("static discovery content", () => { + it("renders the anchor article in full with working section links and installation paths", () => { + const html = renderToStaticMarkup(createElement(WhyDocumentDatabasesPage)); + expect(html.match(/ match[1]); + expect(anchors.length).toBeGreaterThan(0); + for (const anchor of anchors) { + expect(html).toContain(`id="${anchor}"`); + } + expect(html).toContain('href="/docs/getting-started"'); + expect(html).toContain('href="/packages"'); + expect(whyDocumentsMetadata.alternates?.canonical).toBe("/why-document-databases/"); + const article = structuredData(html)["@graph"][0]; + expect(article["@type"]).toBe("TechArticle"); + expect(article.url).toBe("https://documentdb.io/why-document-databases/"); + expect(html).toContain(article.headline); + }); + it("exports standalone install commands without treating an unread query as a valid selection", () => { const html = renderToStaticMarkup(createElement(PackagesPage)); expect(html).toContain('aria-label="Static installation quickstarts"'); From d21442d00ef4ece98f0336ed3eaa3fe7eca8131c Mon Sep 17 00:00:00 2001 From: Lei Jiang Date: Mon, 23 Nov 2026 15:24:38 -0800 Subject: [PATCH 9/9] Campaign landing page and anchor article --- app/campaigns/landing/page.tsx | 31 + .../campaign/AgentPrompts.module.css | 422 ++++++++++++++ app/components/campaign/AgentPrompts.tsx | 197 +++++++ .../campaign/CampaignFilm.module.css | 536 ++++++++++++++++++ app/components/campaign/CampaignFilm.tsx | 353 ++++++++++++ app/components/campaign/filmContent.ts | 77 +++ app/components/campaign/promptContent.ts | 53 ++ app/components/campaign/scene/film.ts | 104 ++++ app/components/campaign/scene/index.ts | 345 +++++++++++ app/components/campaign/scene/materials.ts | 473 ++++++++++++++++ app/components/campaign/scene/mockups.ts | 419 ++++++++++++++ app/components/campaign/scene/palette.ts | 46 ++ app/components/campaign/scene/rig.ts | 339 +++++++++++ app/components/campaign/scene/shell.ts | 291 ++++++++++ app/components/campaign/scene/signal.ts | 120 ++++ .../campaign/scene/stations/docStation.ts | 206 +++++++ .../campaign/scene/stations/gatewayStation.ts | 221 ++++++++ .../campaign/scene/stations/hallStation.ts | 233 ++++++++ .../campaign/scene/stations/heapStation.ts | 501 ++++++++++++++++ .../campaign/scene/stations/indexStation.ts | 337 +++++++++++ .../campaign/scene/stations/phoneStation.ts | 267 +++++++++ .../campaign/scene/stations/vectorStation.ts | 412 ++++++++++++++ app/components/campaign/scene/textures.ts | 240 ++++++++ app/components/campaign/scene/util.ts | 38 ++ app/components/campaign/scene/world.ts | 144 +++++ content/why-document-databases.md | 277 ++++----- package-lock.json | 67 ++- package.json | 4 +- public/images/campaign-film-poster.webp | Bin 0 -> 20378 bytes readme.md | 19 + tests/campaignFilm.test.tsx | 308 ++++++++++ tests/campaignLanding.test.tsx | 75 +++ tests/discoveryContent.test.tsx | 2 +- vitest.config.mts | 4 + 34 files changed, 6991 insertions(+), 170 deletions(-) create mode 100644 app/campaigns/landing/page.tsx create mode 100644 app/components/campaign/AgentPrompts.module.css create mode 100644 app/components/campaign/AgentPrompts.tsx create mode 100644 app/components/campaign/CampaignFilm.module.css create mode 100644 app/components/campaign/CampaignFilm.tsx create mode 100644 app/components/campaign/filmContent.ts create mode 100644 app/components/campaign/promptContent.ts create mode 100644 app/components/campaign/scene/film.ts create mode 100644 app/components/campaign/scene/index.ts create mode 100644 app/components/campaign/scene/materials.ts create mode 100644 app/components/campaign/scene/mockups.ts create mode 100644 app/components/campaign/scene/palette.ts create mode 100644 app/components/campaign/scene/rig.ts create mode 100644 app/components/campaign/scene/shell.ts create mode 100644 app/components/campaign/scene/signal.ts create mode 100644 app/components/campaign/scene/stations/docStation.ts create mode 100644 app/components/campaign/scene/stations/gatewayStation.ts create mode 100644 app/components/campaign/scene/stations/hallStation.ts create mode 100644 app/components/campaign/scene/stations/heapStation.ts create mode 100644 app/components/campaign/scene/stations/indexStation.ts create mode 100644 app/components/campaign/scene/stations/phoneStation.ts create mode 100644 app/components/campaign/scene/stations/vectorStation.ts create mode 100644 app/components/campaign/scene/textures.ts create mode 100644 app/components/campaign/scene/util.ts create mode 100644 app/components/campaign/scene/world.ts create mode 100644 public/images/campaign-film-poster.webp create mode 100644 tests/campaignFilm.test.tsx create mode 100644 tests/campaignLanding.test.tsx diff --git a/app/campaigns/landing/page.tsx b/app/campaigns/landing/page.tsx new file mode 100644 index 0000000..0fda9ca --- /dev/null +++ b/app/campaigns/landing/page.tsx @@ -0,0 +1,31 @@ +import AgentPrompts from "../../components/campaign/AgentPrompts"; +import CampaignFilm from "../../components/campaign/CampaignFilm"; +import { getMetadata } from "../../services/metadataService"; +import { withBasePath } from "../../services/sitePath"; + +const title = "DocumentDB for coding agents - Build with one prompt"; +const description = "Give your coding agent one prompt and get a working app on an open-source document database built on PostgreSQL."; + +export const metadata = { + ...getMetadata({ title, description, path: "/campaigns/landing/" }), + robots: { index: false, follow: false }, +}; + +export default function LandingPage() { + const primary = { label: "Get it running", href: withBasePath("/docs/getting-started/") }; + const secondary = { label: "Choose your deployment", href: withBasePath("/packages/") }; + + return ( +
+ + + +
+ ); +} diff --git a/app/components/campaign/AgentPrompts.module.css b/app/components/campaign/AgentPrompts.module.css new file mode 100644 index 0000000..ca4034a --- /dev/null +++ b/app/components/campaign/AgentPrompts.module.css @@ -0,0 +1,422 @@ +.panel { + display: flex; + flex: 1; + flex-direction: column; + gap: 0.85rem; + min-width: 0; + min-height: 0; + max-height: 36rem; + color: #fff; +} + +.heading h1 { + margin: 0.35rem 0; + font-size: clamp(1.5rem, 3vw, 2.5rem); + font-weight: 600; + line-height: 1.1; + letter-spacing: -0.045em; +} + +.eyebrow { + font-size: 0.75rem; + color: #6ee7b7; +} + +.description, +.intro p { + font-size: 0.8125rem; + line-height: 1.5; + color: #cbd5e1; +} + +.tabs { + display: flex; + flex-shrink: 0; + gap: 0.5rem; +} + +.carouselNav { + display: flex; + flex-shrink: 0; + align-items: stretch; + gap: 0.35rem; +} + +.carouselNav .tabs { + flex: 1; + min-width: 0; +} + +.arrow, +.rotation { + display: grid; + flex-shrink: 0; + place-items: center; + border: 1px solid #374151; + border-radius: 0.5rem; + background: #111b26; + color: #bae6fd; + cursor: pointer; +} + +.arrow { + width: 1.75rem; +} + +.arrow svg { + width: 1rem; + height: 1rem; +} + +.actions { + display: flex; + align-items: center; + gap: 0.35rem; +} + +.rotation svg { + width: 0.75rem; + height: 0.75rem; + fill: currentColor; +} + +.tabs button { + flex: 1; + min-width: 0; + border: 1px solid #374151; + border-radius: 0.65rem; + background: rgba(23, 23, 23, 0.8); + padding: 0.65rem 0.5rem; + font-size: 0.8125rem; + font-weight: 600; + cursor: pointer; +} + +.tabs button[aria-selected="true"] { + border-color: #7dd3fc; + background: #7dd3fc; + color: #05070a; +} + +.panel button:focus-visible, +.panel a:focus-visible, +.prompt textarea:focus-visible { + outline: 2px solid #7dd3fc; + outline-offset: 2px; +} + +.sample { + display: flex; + flex: 1; + flex-direction: column; + min-height: 0; + overflow: hidden; + border: 1px solid rgba(125, 211, 252, 0.25); + border-radius: 1rem; + background: rgba(5, 10, 17, 0.9); + box-shadow: 0 20px 60px -35px rgba(14, 165, 233, 0.4); +} + +.intro { + flex-shrink: 0; + padding: 0.85rem 1rem; +} + +.intro h2 { + margin-bottom: 0.3rem; + font-size: 1rem; + font-weight: 600; + line-height: 1.3; +} + +.sample:has([aria-expanded="false"]) .intro { + display: none; +} + +.toolbar { + display: flex; + flex-shrink: 0; + align-items: center; + justify-content: space-between; + gap: 0.5rem; + border-block: 1px solid #263341; + padding: 0.45rem 0.75rem; +} + +.toolbar button { + border-radius: 0.5rem; + padding: 0.4rem 0.65rem; + font-size: 0.75rem; + font-weight: 600; + cursor: pointer; +} + +.fold { + display: flex; + align-items: center; + gap: 0.3rem; + border: 1px solid #7dd3fc; + background: #111b26; + color: #bae6fd; +} + +.fold:hover { + background: #1c3344; +} + +.fold svg { + width: 1rem; + height: 1rem; +} + +.copy { + background: #7dd3fc; + color: #05070a; +} + +.copy:hover { + background: #bae6fd; +} + +.prompt { + display: flex; + flex: 1; + min-height: 0; +} + +.summary { + flex: 1; + min-height: 0; + overflow: auto; + padding: 0.75rem 1rem; + font-size: 0.8125rem; + line-height: 1.6; + color: #cbd5e1; +} + +.summary p { + margin-bottom: 0.75rem; +} + +.summary a, +.intro a { + color: #7dd3fc; +} + +.summary a:hover, +.intro a:hover { + text-decoration: underline; +} + +.summary div:focus-visible { + outline: 2px solid #7dd3fc; + outline-offset: -2px; +} + +.prompt textarea { + width: 100%; + height: 100%; + min-height: 0; + resize: none; + border: 0; + background: transparent; + padding: 0.75rem 1rem; + font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; + font-size: 0.75rem; + line-height: 1.65; + color: #a7f3d0; +} + +.links { + display: grid; + flex: 1; + grid-template-columns: repeat(2, minmax(0, 1fr)); + align-content: safe center; + gap: 0.65rem; + min-height: 0; + overflow: auto; + padding: 1rem; +} + +.carouselNav[hidden], +.prompt[hidden], +.summary[hidden], +.links[hidden] { + display: none; +} + +.links a { + display: flex; + align-items: center; + justify-content: space-between; + gap: 0.5rem; + border: 1px solid #374151; + border-radius: 0.65rem; + padding: 0.8rem; + font-size: 0.8125rem; + line-height: 1.4; + color: #bae6fd; +} + +.links a:hover { + border-color: #7dd3fc; + background: #111b26; +} + +.preview { + font-size: 0.625rem; + color: #94a3b8; +} + +.status { + flex-shrink: 0; + border-top: 1px solid #263341; + padding: 0.45rem 1rem; + font-size: 0.6875rem; + line-height: 1.4; + color: #a7f3d0; +} + +.error { + color: #fde68a; +} + +.resources { + display: flex; + flex-shrink: 0; + flex-wrap: wrap; + justify-content: space-between; + gap: 0.25rem 0.75rem; + font-size: 0.6875rem; + line-height: 1.5; + color: #94a3b8; +} + +.resources div { + display: flex; + gap: 0.75rem; +} + +.resources a { + color: #7dd3fc; +} + +@media (max-width: 1023px) { + .panel { + gap: 0.5rem; + max-height: none; + } + + .heading h1 { + font-size: 1.5rem; + } + + .intro { + padding: 0.6rem 0.75rem; + } + + .intro h2 { + font-size: 0.875rem; + } +} + +@media (max-width: 639px) { + .resources { + min-height: 2.3125rem; + } + + .description { + display: none; + } + + .links { + padding: 0.5rem; + gap: 0.35rem; + } + + .links a { + padding: 0.4rem; + font-size: 0.6875rem; + } + +} + +@media (max-height: 700px) { + .summary { + padding: 0.35rem 0.65rem; + } + + .panel { + gap: 0.4rem; + } + + .heading h1 { + font-size: 1.4rem; + } + + .description, + .intro p { + display: none; + } + + .intro, + .toolbar { + padding: 0.35rem 0.65rem; + } + + .tabs button, + .links a { + padding: 0.4rem; + } + + .intro h2 { + margin: 0; + font-size: 0.8125rem; + } + + .links { + padding: 0.5rem; + gap: 0.35rem; + } +} + +@media (max-height: 450px) { + .tabs button { + font-size: 0.6875rem; + } + + .summary { + font-size: 0.75rem; + line-height: 1.5; + } + + .panel { + gap: 0.25rem; + } + + .eyebrow, + .resources > span { + display: none; + } + + .heading h1 { + margin: 0; + font-size: 1.125rem; + } + + .prompt textarea { + padding: 0.35rem 0.65rem; + line-height: 1.5; + } + + .links a { + padding: 0.25rem; + font-size: 0.6875rem; + } + + .links { + grid-template-columns: repeat(4, minmax(0, 1fr)); + padding: 0.15rem; + gap: 0.25rem; + } +} diff --git a/app/components/campaign/AgentPrompts.tsx b/app/components/campaign/AgentPrompts.tsx new file mode 100644 index 0000000..8778c66 --- /dev/null +++ b/app/components/campaign/AgentPrompts.tsx @@ -0,0 +1,197 @@ +"use client"; + +import { useEffect, useRef, useState } from "react"; +import { agentKitUrl, galleryRevision, samplePrompts, SAMPLES_GALLERY_URL } from "./promptContent"; +import styles from "./AgentPrompts.module.css"; +import { withBasePath } from "../../services/sitePath"; + +type Link = { label: string; href: string }; +const slides = [{ id: "starter", label: "Starter" }, ...samplePrompts]; + +export default function AgentPrompts({ primary, secondary }: { primary: Link; secondary: Link }) { + const [selected, setSelected] = useState(0); + const [expanded, setExpanded] = useState(true); + const [feedback, setFeedback] = useState<{ id: string; error: boolean } | null>(null); + const [rotating, setRotating] = useState(true); + const [hovered, setHovered] = useState(false); + const [focused, setFocused] = useState(false); + const [visible, setVisible] = useState(true); + const buttons = useRef<(HTMLButtonElement | null)[]>([]); + const slide = slides[selected]; + const prompt = selected === 0 ? null : samplePrompts[selected - 1]; + const currentFeedback = prompt && feedback?.id === prompt.id ? feedback : null; + const rotationActive = rotating && !hovered && !focused && visible && expanded; + + useEffect(() => { + const motion = window.matchMedia("(prefers-reduced-motion: reduce)"); + const updateMotion = () => { if (motion.matches) setRotating(false); }; + const updateVisibility = () => setVisible(!document.hidden); + updateMotion(); + updateVisibility(); + motion.addEventListener("change", updateMotion); + document.addEventListener("visibilitychange", updateVisibility); + return () => { + motion.removeEventListener("change", updateMotion); + document.removeEventListener("visibilitychange", updateVisibility); + }; + }, []); + + useEffect(() => { + if (!rotationActive) return; + const timer = window.setTimeout(() => { + setSelected((index) => (index + 1) % slides.length); + setFeedback(null); + }, 10000); + return () => window.clearTimeout(timer); + }, [rotationActive, selected]); + + function selectSlide(index: number) { + setSelected((index + slides.length) % slides.length); + setFeedback(null); + } + + async function copyPrompt() { + if (!prompt) return; + try { + await navigator.clipboard.writeText(prompt.prompt); + } catch { + setFeedback({ id: prompt.id, error: true }); + return; + } + setFeedback({ id: prompt.id, error: false }); + } + + return ( +
setHovered(true)} onMouseLeave={() => setHovered(false)} + onFocusCapture={() => setFocused(true)} + onBlurCapture={(event) => { + if (!event.currentTarget.contains(event.relatedTarget)) setFocused(false); + }}> +
+

Open source. Agent ready. Yours to run.

+

One prompt. A working app.

+

Start with the basics, or let your agent build a sample.

+
+ + + +
+
+ +
+ {expanded && } + {prompt && } +
+
+
+ {prompt ? <> +

{prompt.title}

+

{prompt.description}

+ : <> +

+ Why are there so many document databases? +

+

A familiar document model. More choice in how you run it.

+ } +
+