Shared Infrastructure

Database (MongoDB)

Declare a database dependency

requires:
  - db

The platform injects MONGODB_URL at runtime. In your code:

const { MongoClient } = require('mongodb');
const client = new MongoClient(process.env.MONGODB_URL);
import os
from pymongo import MongoClient
client = MongoClient(os.environ['MONGODB_URL'])

Database tiers

Every org sits in one tier. Your apps inherit the org’s tier unless overridden.

TierWhatUse case
Pool (default)Shared MongoDB with per-org isolationFree tier, getting started
DedicatedOrg’s own MongoDB instanceCompliance, performance
ExternalOrg supplies own connection stringFull control (Atlas, etc.)

Entity-level overrides

For sensitive data that needs its own database:

requires:
  - { db: private }          # Entity gets its own MongoDB in its namespace

For bring-your-own database:

requires:
  - { db: external, secret: MY_MONGODB_URL }

vault:
  MY_MONGODB_URL: my-mongo-conn-string

For non-MongoDB databases (Postgres, MySQL) via native egress:

requires:
  - { external_db: native, port: 5432 }   # Postgres
  - { external_db: native, port: 3306 }   # MySQL