Discloud One‑Click MongoDB Add‑On: Provision, Connect, and Limits
Learn how Discloud’s one‑click MongoDB add‑on provisions a managed database, injects MONGODB_URI, and what limits the free tier imposes on storage, backups, and performance.
14 Jun 2026, 17:53 UTC

The problem: getting a managed MongoDB instance without leaving the Discloud workflow
When you deploy a Node.js service on Discloud you often need a database quickly. Spinning up a separate MongoDB cluster, handling credentials, and wiring the connection string into your app adds friction and a surface for mis‑configuration. Discloud’s one‑click MongoDB add‑on promises to remove that friction by provisioning a managed instance, generating credentials, and injecting a MONGODB_URI environment variable automatically.
What the add‑on actually does
- Creates a managed MongoDB deployment (versions 4.4 or 5.0).
- Generates a unique username/password pair.
- Exposes the connection string as
MONGODB_URIin the linked app’s environment. - Rotates credentials without downtime – the platform updates the env var for you.
- Provides automated daily backups (7‑day retention on the free tier).
Provisioning from the dashboard
- Open your app in the Discloud dashboard.
- Navigate to Add‑ons → MongoDB.
- Click Add and confirm the plan (free or paid).
- After a few seconds the
MONGODB_URIentry appears under Environment Variables.
Provisioning from the CLI
Run the following command from a terminal where the Discloud CLI is authenticated (requires discloud login first). Replace <app-name> with your actual application slug.
discloud addon add mongodb <app-name>
The CLI prints the generated URI and confirms that the environment variable has been set. This mirrors the dashboard flow and is scriptable for CI pipelines.
Worked example: connecting a Node.js app
Assume a minimal Express service. The only code change required is reading the injected variable.
// server.js
const { MongoClient } = require('mongodb');
const uri = process.env.MONGODB_URI; // injected by Discloud
if (!uri) {
console.error('MONGODB_URI not set – is the add‑on attached?');
process.exit(1);
}
const client = new MongoClient(uri);
await client.connect();
console.log('Connected to MongoDB');
// ... use client.db() ...
Deploy the app (e.g., discloud deploy) and watch the logs. A successful connection message confirms that the add‑on is correctly provisioned and reachable.
Verification checklist
- Dashboard: Environment Variables list shows
MONGODB_URIwith amongodb://ormongodb+srv://scheme. - CLI: Run
discloud env get <app-name> MONGODB_URI– it should return the same string. - Runtime test: Add a one‑off script that logs
process.env.MONGODB_URIand attemptsclient.connect(). Success = green light.
Trade‑offs and limitations
| Aspect | Free tier | Paid plans |
|---|---|---|
| Storage | 512 MB (shared) | Up to 10 GB, dedicated |
| Backup retention | 7 days | 30 days + point‑in‑time recovery |
| Performance | Throttled under load | Provisioned IOPS, no throttling |
| Scaling | Manual plan upgrade only | Vertical storage scaling via UI/CLI |
If your workload is write‑heavy or you need longer backup history, the free tier will become a bottleneck. The add‑on does not expose replica‑set configuration or custom MongoDB parameters – you get a managed single‑node (or replica‑set on paid) instance with sensible defaults.
Actionable next step
Attach the MongoDB add‑on to a staging app today, run the verification checklist, and measure latency on a realistic write load. If you hit the 512 MB ceiling or see throttling, plan a paid‑tier upgrade before promoting to production. The zero‑downtime credential rotation means you can switch tiers without redeploying code – just change the plan in the dashboard and the MONGODB_URI updates automatically.
0 replies
A thoughtful contribution can make all the difference. Be the first to share one.