Skip to main content

Database capacity planning

Operational sizing of the MongoDB Atlas cluster powering Retrieva — current state, per-entity footprint, scenarios, and upgrade thresholds.

Current state (snapshot)

Live measurement against the production Atlas free tier (M0) cluster, database enterprise_rag:

MetricValue
Collections19
Total objects35
dataSize0.05 MB
storageSize (compressed)0.47 MB
indexSize1.42 MB
Used (data + indexes)1.47 MB / 512 MB (0.3%)
Remaining510.5 MB
Index size dominates today

At this early-life stage the indexes weigh ~28× the data. That's normal for an empty cluster (~10 indexes per collection × 19 collections = ~190 indexes, each ~7-10 KB of metadata + B-tree pages). It means that as volume grows, indexes will scale proportionally — budget for 25-30% index overhead on top of every data growth projection.

Top collections by total footprint (size + indexes):

CollectionDocsSize (MB)Indexes (MB)
assessments30.010.21
conversations70.000.19
workspacemembers10.000.18
messages180.020.14
workspaces10.000.14
organizationmembers10.000.14
users10.000.07
organizations10.000.07
questionnairetemplates10.010.05

The 10 other collections (DLQ, document sources, sparse vectors, vocabularies, inverted indexes, vendor questionnaires, datasources, content hashes, workspace stats, changelog) are empty or near-empty in this snapshot — vestiges of earlier semantic-search experiments and pre-allocated slots for upcoming features.

MongoDB Atlas free tier (M0) — hard limits

ResourceM0 limitNote
Storage512 MBHard cap. Writes block once reached.
RAM~512 MB sharedMulti-tenant on the underlying host — latency variable under contention.
vCPUSharedNo performance guarantee.
Concurrent connections500Generous; rarely the bottleneck for this stack.
Automatic backups❌ NoneThe biggest operational risk.
Atlas Search3 indexes max, limitedNot used today (vector store is Qdrant, separate).
NetworkSoft throttleNo hard quota, but Atlas may throttle on abuse.
Monitoring / auditVery limitedLimited visibility on incidents.
Upgrade pathM0 → M2 ($9/mo) → M10 ($57/mo) → …In-place migration, low downtime.

Per-entity sizing (Mongoose model estimates)

Conservative averages based on the actual Mongoose schemas:

EntityAverage sizeNotes
User~2 KBbcrypt hash + encrypted MFA secret + lastLogin
Organization~1 KBmetadata + plan + trial
OrganizationMember~0.5 KBuserId + role + permissions
Workspace (= vendor)~5 KBvendor profile + certifications + contract + ICT functions
WorkspaceMember~0.5 KBuserId + role + 3 permissions
Assessment (DORA, complete)30-80 KBresults.gaps[] typically 20-50 entries × 1-2 KB
Assessment (CONTRACT_A30 with signoffs)40-90 KB+ 12 clauseSignoffs × 1 KB
VendorQuestionnaire (complete)~15-30 KBquestions + responses + scoring
Conversation~1 KBmetadata only
Message (user)~2 KB
Message (assistant with sources)5-15 KBsources[] carries excerpts + scores
AuditLog (post #348)~1 KBper audited action
Finding (post #365)~3 KB+ history
Subcontractor (post #350)~1 KB

Plus the ~25-30% index overhead observed in the live snapshot — multiply every data projection by 1.3.

Capacity scenarios

Scenario A — Demo / pilot (very light)

5 users · 10 vendors · 1 DORA assessment + 1 A30 per vendor · 10 conversations × 5 messages each.

ItemCalcSize
Users + Org + Members5×2 + 1 + 5×0.5 + 10×0.5×3~30 KB
10 Workspaces10 × 550 KB
20 Assessments10 × (50 + 60)~1.1 MB
10 Questionnaires10 × 20200 KB
Chat10 × 5 × 8 KB400 KB
Index overhead (~30%)~550 KB
Total / org~2.4 MB

→ M0 holds ~200 organisations at this usage level.

Scenario B — Realistic production SME

10 users · 50 vendors · 2 DORA + 1 A30 assessments per year per vendor · moderate chat (50 conv × 15 msg).

ItemCalcSize
Users + Org + Members10×2 + 1 + 10×0.5 + 50×0.5×3~100 KB
50 Workspaces50 × 5250 KB
150 Assessments50 × (2×50 + 60)~8 MB
50 Questionnaires50 × 201 MB
Chat50 × 15 × 10 KB7.5 MB
AuditLog (~5,000 entries/yr, post #348)5 MB
Index overhead (~30%)~6.5 MB
Total / org / yr~28 MB

→ M0 holds ~15-18 organisations at this usage level.

Scenario C — HDI Affinitaire (200 vendors, 30-person team)

30 users · 200 vendors · 3 assessments per vendor per year · heavy chat (200 conv × 30 msg) · Findings tracker active.

ItemCalcSize
Users + Org + Members30×2 + 1 + 30×0.5 + 200×30×0.5~3.2 MB
200 Workspaces200 × 51 MB
600 Assessments200 × 3 × 6036 MB
200 Questionnaires200 × 204 MB
Chat200 × 30 × 10 KB60 MB
AuditLog (~30k entries/yr)30 MB
Findings (~3,000 open)9 MB
Subcontractors (~500)0.5 MB
Index overhead (~30%)~43 MB
Total / org / yr~186 MB

→ M0 holds ~2-3 customers of this size. Far too tight for real production.

What blows up first

Statistically, in this order:

  1. 🔴 Storage (512 MB) — bottleneck #1. Chat copilot + AuditLog + assessments fill it fast. A single real customer at HDI scale would exhaust M0 in 2-3 months.
  2. 🟠 LLM-related query latency — not a hard limit, but RAG queries against Conversation.list and Message.find become visibly slow above ~100 MB of chat data because of the shared CPU.
  3. 🟡 No backups — not a capacity limit but the most severe operational risk. Without backups, an incident is catastrophic — and no regulator will validate a Retrieva deployment without a backup policy.
  4. 🟢 Connections (500) — never hit in practice with the current architecture (API + workers + dev sessions = ~30 max).

Upgrade thresholds and pricing (Atlas dedicated)

TierStorageRAMCost / monthUse case
M0 (current)512 MB0.5 GB shared$0Demo only, < 5 small orgs
M22 GB0.5 GB$9Pilot / 10-15 small orgs
M55 GB0.5 GB$25Light production / 1-3 SME customers
M1010 GB2 GB$57First serious production / 1 HDI-scale customer + backups
M2020 GB4 GB$146Multi-customer SME production (5-10)
M3040 GB8 GB$384Real multi-tenant production / 10-30 HDI-scale customers
M10 is the "sellable to compliance" floor

From M10 onwards Atlas unlocks automatic backups (continuous + on-demand snapshots) and dedicated RAM. Below M10, a compliance officer at a regulated entity cannot validate the platform — they will ask about disaster recovery, and the answer must include backups.

Recommendations

PhaseAction
Today (dev / demo / lead nurture)M0 is fine. Check db.stats() once a week. Plan the upgrade when dataSize + indexSize crosses 300 MB (~60% full).
Before first paying customer (even PoC)Upgrade to M10. Unlocks continuous backups, dedicated RAM, predictable chat-copilot latency, Atlas SLA, monitoring visibility. Non-negotiable for any sales motion.
At 3-5 production customers, or one HDI-scale customerMove to M20-M30. By then revenue covers the $146-$384/month easily.
Before signing HDI or similar regulated enterpriseM30 + enable Atlas Backup Encryption + enable Field Level Encryption on the sensitive collections (AssessmentRiskDecision, ClauseSignoff, User). These are the controls the regulator checks.

Capacity self-check (run anytime)

Connect with mongosh to the cluster and run:

use enterprise_rag;
const s = db.runCommand({ dbStats: 1, scale: 1 });
const mb = (b) => (Number(b) / 1024 / 1024).toFixed(2);
print("dataSize: " + mb(s.dataSize) + " MB");
print("storageSize: " + mb(s.storageSize) + " MB");
print("indexSize: " + mb(s.indexSize) + " MB");
print("used: " + mb(Number(s.dataSize) + Number(s.indexSize)) + " MB of 512 MB on M0");

db.getCollectionNames().sort().forEach(c => {
const cs = db.runCommand({ collStats: c, scale: 1 });
print(c.padEnd(38) +
String(cs.count).padStart(8) +
mb(cs.size).padStart(10) + " MB" +
mb(cs.totalIndexSize).padStart(10) + " MB idx");
});

Save the result with db.stats() in a weekly cron so growth is tracked over time. When you cross 300 MB, schedule the M10 migration before the next sales call.

Marginal infrastructure cost summary

Customer count (mixed sizes)Atlas tierMonthly cost
0 paying (dev only)M0$0
1 paying PoCM10$57
3 SME + 1 HDI-classM30$384
10 SME + 2 HDI-classM40+ or dedicated cluster$700-1,200

At expected ARR per customer ($30k-150k depending on segment), Mongo infrastructure stays well under 1% of revenue — never the cost lever to optimise.

  • /docs/deployment/production-checklist.md — full production readiness checklist
  • /docs/deployment/environment-variables.mdMONGODB_URI configuration
  • /docs/security/data-protection.md — encryption at rest, Field Level Encryption setup