MongoDB : Architecture Decision Matrix

Progress 0%
MongoDB
Node Description

Value Proposition (Clickable)
Data & Workload
Scalability & Performance
Platform & Integration
Deployment & Security
Exit / Alternative
Final Architecture

Node Title

Value Proposition ...

...

Read Documentation β†’
%%{init: {'theme': 'base', 'flowchart': {'curve': 'basis', 'layout': 'dagre', 'nodeSpacing': 180, 'rankSpacing': 200}, 'themeVariables': { 'background': 'transparent', 'mainBkg': 'transparent', 'fontFamily': 'Inter', 'fontSize': '16px', 'lineColor': '#ffffff' }}}%% flowchart TB Start(["Start: Strategic Vision"]) --> WorkloadCheck{"**Workload Nature**
Transactional or
Analytical?"} %% Analytical Path WorkloadCheck -- Analytical (OLAP) --> AnalyticCheck{"**Analytical Nuance**
Massive Joins (10+),
Full Table Scans, OR
Deep History (>500TB active data set)?"} AnalyticCheck -- Yes (Data Warehouse) --> DWH["**Data Warehouse / Lakehouse**
Snowflake / Databricks
(Cost Efficiency for Cold Data)"] AnalyticCheck -- "No (Real-Time Analytics)" --> DevSkill{"**Team Skillset**
Code-First (Devs)
or SQL-First (DBAs)?"} %% Transactional Path - Direct to DevSkill WorkloadCheck -- Transactional (OLTP) --> DevSkill %% Developer Skillset Branch DevSkill -- "SQL-First" --> AcidCheck{"**ACID Nuance**
Multi-table transactions
across 10+ tables?"} DevSkill -- "Code-First" --> ObjMatch["**Value: Dev Experience**
No ORM / Impedance Mismatch"] %% SQL-First Path AcidCheck -- Yes --> NormalizationCheck{"**Rigid Data Model**
is data is 3rd or 4th Normal form?"} AcidCheck -- No --> VolCheck{"**Volume Nuance**
Writes < 1k/sec?"} NormalizationCheck -- No --> RigidSQL{"**Business Logic Check**
Is logic embedded in
SQL / PL/SQL?"} RigidSQL -- Yes --> RDBMS["**RDBMS**
SQL / Oracle"] RigidSQL -- No --> Migrator["**Relational Migrator**
Schema Transformation"] Migrator -- extension --> AMP["**MongoDB AMP**"] NormalizationCheck -- Datamodel Optimization --> Migrator Migrator --> MongoCore["**MongoDB Core**
Flexible Schema"] VolCheck -- Yes --> RDBMS VolCheck -- No --> MongoCore %% Code-First Path ObjMatch --> DataNature{"**Data Nature**
Is the schema volatile
or hierarchical?"} DataNature -- Yes (JSON) --> GraphCheck{"**Graph Nuance**
Unbounded depth
(> 5 hops)?"} DataNature -- No (Rigid) --> AcidCheck GraphCheck -- Yes --> GraphDB["**Graph Database**"] GraphCheck -- No --> KVCheck{"**Key-Value Nuance**
Simple ID Lookup?"} KVCheck -- Yes --> Latency{"**Latency Nuance**
Need <1ms response
& OK with data loss?"} Latency -- Yes --> Redis["**Redis / Memcached**"] Latency -- No --> MongoCore KVCheck -- No (Complex) --> QueryCheck{"**Query Nuance**
Need robust filtering,
secondary indexes,
or aggregations?"} QueryCheck -- Yes --> MongoCore QueryCheck -- No (Basic Queries) --> MongoCore %% MongoDB Core β†’ Velocity Check (Business Model / Multi-Tenancy removed β€” cosmetic only) MongoCore --> Agility{"**Velocity Check**
Does schema change
frequently?"} %% Velocity & Scaling Agility -- Yes --> AgileVal["**Value: High Agility**
Faster Time-to-Market"] Agility -- No --> ScaleCheck{"**Scale Check**
Data > 2TB OR
Writes > 50k/s?"} AgileVal --> ScaleCheck ScaleCheck -- Yes --> ShardStrat{"**Sharding Strategy**
Access Pattern?"} ShardStrat -- Distributed Writes --> HashShard["**Hashed Sharding**
Uniform Distribution"] ShardStrat -- Location Based --> ZoneShard["**Zone Sharding**
Data Locality"] ShardStrat -- Range Queries --> RangeShard["**Ranged Sharding**
Time/Alpha Grouping"] ScaleCheck -- No --> Replica["**Replica Set**
High Availability"] HashShard --> PlatCheck{"**Workload Nuance**
Need Search, AI,
Streams, or Time Series?"} ZoneShard --> PlatCheck RangeShard --> PlatCheck Replica --> PlatCheck %% Platform Features PlatCheck -- Just CRUD --> Integration{"**Ecosystem Check**
Need mature connectors
(Kafka/Spark)?"} PlatCheck -- "Real-Time Streams" --> StreamCheck{"**Streaming Nuance**
Process data in-flight?"} StreamCheck -- "External (Kafka+Flink)" --> Flink["**Manage Separate Infra**
Complex Glue Code"] StreamCheck -- "Unified (Native)" --> ASP["**Atlas Stream Processing**
Continuous Intelligence"] PlatCheck -- Search --> SearchDec{"**ETL Tolerance**
Want to manage
sync pipelines?"} SearchDec -- Yes --> Elastic["**Search Engine**"] SearchDec -- No --> AtlasSearch["**Atlas Search**
Lucene on Node"] PlatCheck -- AI/Vector --> AIUse{"**AI Pattern**
How is Vector used?"} AIUse -- Chat History --> AgentMem["**Agent Memory**
Long-Term Context"] AIUse -- Reduce LLM Cost --> SemCache["**Semantic Cache**
Prevent Re-runs"] AIUse -- Knowledge Base --> RAG["**Knowledge Graph**
RAG + Filters"] PlatCheck -- IoT --> TimeSeries["**Time Series**
Columnar Store"] AtlasSearch --> Consolidation["**Value: Consolidation**
Reduced Tech Debt"] AgentMem --> Consolidation SemCache --> Consolidation RAG --> Consolidation TimeSeries --> Consolidation ASP --> Consolidation Flink --> Integration Consolidation --> Integration %% Deployment Path Integration -- No (Isolated) --> DeployCheck{"**Deployment**
Can data touch
public cloud?"} Integration -- Yes --> Connectors["**Value: Ecosystem**
Official Drivers/Connectors"] Connectors --> DeployCheck DeployCheck -- "No (Air-gapped)" --> SelfMan{"**Self-Managed**
Infrastructure?"} SelfMan -- Containers --> K8s["**Enterprise Operator**
OpenShift/K8s"] SelfMan -- VM/Metal --> OpsMan["**Ops Manager**
Automation"] K8s --> Secure@{ label: "**Trust Level**
Need 'Eyes-Off'?" } OpsMan --> Secure DeployCheck -- Yes (Cloud) --> Portability{"**Lock-In Check**
Need Cloud Agnostic
or Exit Strategy?"} Portability -- No (spefic Native) --> Dynamo["
cloud specific databases"] Portability -- Yes (Portable) --> NetCheck{"**Network Security**
Connection Method?"} NetCheck -- AWS/Azure Backbone --> PrivLink["**PrivateLink**
One-way Security"] NetCheck -- VPC Peering --> Peering["**VPC Peering**
Bi-directional"] NetCheck -- Public Internet --> IPList["**IP Whitelist**
Standard TLS"] PrivLink --> RTOCheck{"**DR Strategy**
RTO/RPO Requirements?"} Peering --> RTOCheck IPList --> RTOCheck RTOCheck -- "Near-Zero RPO
(Multi-Cloud Resilience)" --> MultiCloud["**Multi-Cloud Cluster**
AWS+Azure+GCP"] RTOCheck -- Minutes (Standard)
(Single Region) --> Standard["**Standard Cluster**
3-Node Replica"] Standard --> Lifecycle{"**Cost Efficiency**
Retain history > 90 days?"} MultiCloud --> Lifecycle Lifecycle -- Yes --> Archive["**Online Archive**
Auto-Tiering to S3"] Lifecycle -- No --> ObsCheck{"**Ops Nuance**
Need Automated
Deployment Strategies ? Performance Tuning?"} Archive --> ObsCheck ObsCheck -- No (Manual) --> ManualOps["**Manual Tuning**
Query Analysis"] ObsCheck -- Yes (Intelligent) --> PerfAdv["**MongoDB Atlas Landing Zone and Performance/Query Advisor**
*Templatized Deployment Configurations for control and ease of use
*Query Performance Visualization
*Auto-Index Suggest"] PerfAdv --> Secure ManualOps --> Secure Secure -- Yes (Regulated and High Compliance Requirements) --> CSFLE["Queryable Encryption
Client-Side filed encryptions
encryption at rest (KMIP)
encryption in motion

Compliance - First Platform
"] Secure -- No --> Final(["**Final DB choice : MongoDB**"]) CSFLE --> Final AMP -.-> Consolidation %% --- CLICK BINDINGS --- click ObjMatch showInfo click AgileVal showInfo click Consolidation showInfo click Migrator showInfo click MongoCore showInfo click HashShard showInfo click ZoneShard showInfo click RangeShard showInfo click Replica showInfo click ASP showInfo click AtlasSearch showInfo click Vector showInfo click AgentMem showInfo click SemCache showInfo click RAG showInfo click TimeSeries showInfo click Connectors showInfo click K8s showInfo click OpsMan showInfo click PrivLink showInfo click Peering showInfo click IPList showInfo click MultiCloud showInfo click Standard showInfo click Archive showInfo click PerfAdv showInfo click CSFLE showInfo click AMP showInfo click Final "https://cloud.mongodb.com/" "Start with MongoDB Atlas" _blank %% --- STYLING --- Secure@{ shape: diamond} Start:::startNode WorkloadCheck:::techZone AnalyticCheck:::techZone DWH:::exitNode DevSkill:::techZone AcidCheck:::techZone ObjMatch:::valueNode DataNature:::techZone NormalizationCheck:::techZone RigidSQL:::techZone RDBMS:::exitNode Migrator:::valueNode AMP:::valueNode MongoCore:::valueNode VolCheck:::techZone GraphCheck:::techZone GraphDB:::exitNode KVCheck:::techZone Latency:::techZone Redis:::exitNode QueryCheck:::techZone Agility:::techZone AgileVal:::valueNode ScaleCheck:::scaleZone ShardStrat:::scaleZone HashShard:::valueNode ZoneShard:::valueNode RangeShard:::valueNode Replica:::valueNode PlatCheck:::platZone Integration:::platZone StreamCheck:::platZone Flink:::techZone ASP:::valueNode SearchDec:::platZone Elastic:::exitNode AtlasSearch:::valueNode AIUse:::platZone AgentMem:::valueNode SemCache:::valueNode RAG:::valueNode TimeSeries:::valueNode Consolidation:::valueNode DeployCheck:::deployZone Connectors:::valueNode SelfMan:::deployZone K8s:::valueNode OpsMan:::valueNode Secure:::deployZone Portability:::deployZone Dynamo:::exitNode NetCheck:::deployZone PrivLink:::valueNode Peering:::valueNode IPList:::valueNode RTOCheck:::deployZone MultiCloud:::valueNode Standard:::valueNode Lifecycle:::deployZone Archive:::valueNode ObsCheck:::deployZone ManualOps:::deployZone PerfAdv:::valueNode CSFLE:::valueNode Final:::Aqua classDef startNode fill:#333,stroke:#333,stroke-width:2px,color:#fff classDef techZone fill:#E3F2FD,stroke:#1565C0,stroke-width:2px,color:#000 classDef scaleZone fill:#FFF3E0,stroke:#EF6C00,stroke-width:2px,color:#000 classDef platZone fill:#F3E5F5,stroke:#7B1FA2,stroke-width:2px,color:#000 classDef deployZone fill:#E8F5E9,stroke:#2E7D32,stroke-width:2px,color:#000 classDef valueNode fill:#00ED64,stroke:#00684A,stroke-width:3px,font-weight:bold,color:#000 classDef exitNode fill:#F5F5F5,stroke:#616161,stroke-width:1px,stroke-dasharray: 5 5,color:#666 classDef Sky stroke-width:1px, stroke-dasharray:none, stroke:#374D7C, fill:#E2EBFF, color:#374D7C classDef Aqua stroke-width:1px, stroke-dasharray:none, stroke:#46EDC8, fill:#DEFFF8, color:#378E7A
πŸ“‹

Decision Logic Table

Complete breakdown of all recommendation paths. Use this to understand exactly how the wizard makes its recommendations.

How to Read This Table

  • Conditions: Answers that trigger this recommendation path
  • Database Choice: The recommended database/architecture
  • Reason Code: Internal identifier for this decision path
  • Key Features: Recommended features/capabilities for this use case
Conditions Database Choice Reason Code Key Features
🌊 STREAMS PROCESSING (1 path)
Q18 Advanced Features: Streams selected MongoDB + Stream Processing streams-processing Atlas Stream Processing (cloud), Change Streams, Kafka Integration
πŸ“± MOBILE / OFFLINE-FIRST (1 path)
Q0 Use Case: Mobile
OR Q23 Mobile Offline: Yes
MongoDB + Offline Sync Partners mobile-offline Ditto, PowerSync, ObjectBox (sync partners), Local Database, Conflict Resolution
πŸ“Š LOG ANALYTICS (2 paths)
Q0 Use Case: Logs
Q11 Traffic: Massive (Petabyte)
Search Engine + Data Lakehouse log-analytics Elasticsearch/OpenSearch, Data Lakehouse, Long-term Retention
Q0 Use Case: Logs
Q11 Traffic: Moderate or less
MongoDB + Atlas Search log-analytics Atlas Search (<3TB index), Time Series Collections, Unified Platform
πŸ“‘ IoT / TIME SERIES WORKLOADS (3 paths)
Q0 Use Case: IoT
Q11 Traffic: Massive
Time Series Engine + MongoDB (Operational)
SQL-aware: DB logic β†’ RDBMS + TS Engine; isStrong β†’ both; else β†’ MongoDB
iot-massive Time Series Warehouse, Operational Layer, Data Federation
Q0 Use Case: IoT
Q11 Traffic: Very Small
Q5 Team: SQL-first
Q9 ACID: Heavy
Q10 Normalization: Rigid
RDBMS (Operational) + Time Series Extensions iot-small-sql Time Series Extensions, PostgreSQL Compatibility, Continuous Aggregates
Q0 Use Case: IoT
Q11 Traffic: Small to Large
(Default IoT path)
MongoDB Time Series
SQL-aware: significant SQL signals β†’ MongoDB or RDBMS TS Extensions
timeseries-universal Time Series Collections, Bucket Pattern, Columnar Compression, Data Tiering
πŸ“Š ANALYTICAL WORKLOADS (5 paths)
Q1 Workload: Analytical
Q14 Data Structure: Graph
Q15 Graph Depth: Deep (>5 hops)
Graph Database analytical-deep-graph Graph Algorithms, Centrality Analysis, Community Detection, Path Finding
Q1 Workload: Analytical
Q14 Data Structure: Graph
Q15 Graph Depth: Shallow (≀5 hops)
MongoDB ($graphLookup)
SQL-aware: isStrong β†’ Hybrid; significant β†’ MongoDB or RDBMS (CTEs)
analytical-shallow-graph $graphLookup, Aggregation Pipeline, Hierarchies, Recursive CTEs (RDBMS)
Q1 Workload: Analytical
Q2 Analytical Nuance: Warehouse
OR Q11 Traffic: Massive
Data Warehouse analytical-warehouse Columnar Storage, MPP Queries, Massive Joins, Full Table Scans
Q1 Workload: Analytical
Q2 Analytical Nuance: Real-time
Q21 Deployment: On-premise
MongoDB Enterprise (Analytics Nodes) or Data Warehouse
SQL-aware: isStrong β†’ Hybrid; significant β†’ MongoDB or RDBMS / DW
analytical-realtime-onprem Read-Only Nodes, Analytics Workload Isolation
Q1 Workload: Analytical
Q2 Analytical Nuance: Real-time
Q21 Deployment: Cloud
MongoDB Atlas (Analytics Nodes) or Cloud Data Warehouse
SQL-aware: isStrong β†’ Hybrid; significant β†’ MongoDB or RDBMS / DW
analytical-realtime-cloud Analytics Nodes, Workload Isolation, Materialized Views
πŸ”— TRANSACTIONAL GRAPH WORKLOADS (2 paths)
Q1 Workload: Transactional
Q14 Data Structure: Graph
Q15 Graph Depth: Deep (>5 hops)
MongoDB (Operational) + Graph Database transactional-deep-graph Hybrid Architecture, MongoDB for Operations, Graph Database for Graph Queries
Q1 Workload: Transactional
Q14 Data Structure: Graph
Q15 Graph Depth: Shallow (≀5 hops)
MongoDB ($graphLookup)
SQL-aware: isStrong β†’ Hybrid; significant β†’ MongoDB or RDBMS (CTEs)
transactional-shallow-graph $graphLookup, Document References, Aggregation Pipeline, Recursive CTEs (RDBMS)
πŸ—„οΈ SQL-FIRST TEAM PATHS (5 paths)
Q5 Team: SQL-first
Q8 Business Logic: In Database
Q11 Traffic: Large or Massive
RDBMS (with limitations) or Distributed SQL sql-database-logic-large-scale Stored Procedures, Triggers, Functions (Consider Distributed SQL for scale)
Q5 Team: SQL-first
Q8 Business Logic: In Database
Q11 Traffic: Very Small to Medium
RDBMS sql-database-logic Stored Procedures, Triggers, SQL Functions, Mature Ecosystem
Q5 Team: SQL-first
Q6 Migration: Yes (from RDBMS)
Q9 ACID: Heavy
Q10 Normalization: Rigid
MongoDB (with migration support) sql-modernization Relational Migrator, Multi-Doc Transactions, SQL Drivers, Schema Design
Q5 Team: SQL-first
Q8 Business Logic: App-tier or No preference
Q9 ACID: Heavy
Q10 Normalization: Rigid
Q11 Traffic: Massive (Petabyte)
Distributed SQL OR MongoDB (Hot) + Online Archive (Cold) + Data Warehouse sql-heavy-acid-massive Traditional RDBMS won't scale. No single DB handles petabyte efficiently. Tiered architecture required: Hot + Cold + Analytics tiers
Q5 Team: SQL-first
Q9 ACID: Heavy
Q10 Normalization: Rigid
Q11 Traffic: Large
RDBMS (with Option 1/2) sql-heavy-acid-large RDBMS can work with scaling strategies. Presents Option 1 (scale RDBMS) vs Option 2 (modernize to MongoDB)
Q5 Team: SQL-first
Q6 Migration: No (New App)
Q9 ACID: Heavy
Q10 Normalization: Rigid
Q11 Traffic: Small/Very Small
RDBMS or MongoDB sql-heavy-acid For new apps: Both are excellent. RDBMS for SQL familiarity; MongoDB for agility and future scalability
Q5 Team: SQL-first
Q6 Migration: N/A (Existing)
Q9 ACID: Heavy
Q10 Normalization: Rigid
Q11 Traffic: Small/Very Small
RDBMS sql-heavy-acid Existing RDBMS workload - no need to change what works
Q5 Team: SQL-first
(Moderate requirements - not Heavy ACID + Rigid)
MongoDB or RDBMS (if heavy ACID or rigid schema signals present, both suggested) sql-moderate SQL Compatibility Layer, Relational Migrator, Flexible Schema (or RDBMS equivalents)
πŸͺ USE CASE SPECIFIC PATHS (6 paths)
Q0 Use Case: SaaS MongoDB (Multi-Tenant)
isStrong β†’ RDBMS (or Hybrid at large scale)
saas-multitenant Multi-Tenancy, Tenant Isolation, Flexible Schemas
Q0 Use Case: E-Commerce MongoDB (Product Catalog + Orders)
isStrong β†’ RDBMS (or Hybrid at large scale)
ecommerce Product Catalog, Order Management, Session Handling
Q0 Use Case: CMS / Content MongoDB (Flexible Content)
isStrong β†’ Hybrid
cms-content Flexible Schema, Content Management, Document Model
Q0 Use Case: Marketplace MongoDB
isStrong β†’ RDBMS (or Hybrid at large scale)
marketplace Multi-Vendor Catalog, Search, Transactions
Q0 Use Case: Social Network MongoDB (or + Graph DB for deep graph)
isStrong β†’ Hybrid or RDBMS + Graph DB
social-network Social Graph, Activity Feeds, Notifications, Graph Depth Aware
Q0 Use Case: Custom / Other MongoDB
isStrong β†’ RDBMS
custom-explore Exploratory, SQL Constraint Aware
πŸ’» CODE-FIRST TEAM PATHS (2 paths)
Q5 Team: Code-first
Q14 Data Structure: Document
MongoDB codefirst-document Flexible Schema, Document Model, Native Drivers, BSON Support
Q5 Team: Code-first
Q14 Data Structure: Rigid/Normalized
MongoDB (with Schema Validation) codefirst-rigid JSON Schema Validation, Enforced Structure, Data Governance
βš™οΈ DEFAULT FALLBACK (1 path)
No specific conditions matched
Three-tier SQL-awareness applies
isStrong β†’ RDBMS
significant SQL signals β†’ MongoDB or RDBMS
else β†’ MongoDB (Atlas or Enterprise)
default Standard Deployment, Replica Set, Auto-scaling (Atlas)

πŸ€– VECTOR SEARCH / AI WORKLOADS (2 paths)

Conditions Database Choice Reason Code Key Features
Q18 Advanced Features: AI/Vector Search selected
Q20 Vector Scale: Billions+ vectors
Vector Search Engine + MongoDB (Operational) vector-search-massive β€’ Specialized vector DB
β€’ Billions of embeddings
β€’ MongoDB for metadata
β€’ Hybrid architecture
Q18 Advanced Features: AI/Vector Search selected
(Standard scale or not specified)
MongoDB Atlas (Vector Search) vector-search-standard β€’ Atlas Vector Search
β€’ Semantic search
β€’ RAG applications
β€’ ML embeddings storage

πŸ” FULL-TEXT SEARCH WORKLOADS (2 paths)

Conditions Database Choice Reason Code Key Features
Q18 Advanced Features: Full-Text Search selected
Q19 Search Scale: Petabyte-Scale
Search Engine + MongoDB (Operational) fulltext-search-petabyte β€’ Petabyte-scale search
β€’ Log analytics optimized
β€’ MongoDB for operational
β€’ Dedicated search cluster
Q18 Advanced Features: Full-Text Search selected
(Moderate scale or not specified)
MongoDB Atlas (Atlas Search) fulltext-search-moderate β€’ Atlas Search
β€’ Lucene-based indexing
β€’ Fuzzy search, autocomplete
β€’ Single platform

πŸ“Œ Important Notes

  • Complete Coverage: This table contains all 33 decision paths from the recommendation engine, organized into 13 categories.
  • Question IDs: Each condition references specific wizard questions (e.g., Q0 = Use Case, Q5 = Team Skillset, Q9 = ACID Needs, Q10 = Normalization, Q11 = Traffic Pattern, Q14 = Data Structure, Q18 = Advanced Features, Q21 = Deployment).
  • Evaluation Order: Conditions are checked in order of specificity - more specific conditions are evaluated first.
  • Three-Tier SQL Awareness: Rules use getSQLConstraints() with three tiers: isStrong (SQL-first + DB logic or heavy ACID + rigid) β†’ RDBMS primary; hasSignificantSQLSignals (SQL-first + heavy ACID or rigid, but not strong) β†’ both suggested; isModerate (SQL-first only) β†’ MongoDB primary.
  • Scale Awareness: All recommendations consider scale. At massive/petabyte scale, tiered architectures (Hot + Cold + Analytics) are recommended.
  • Balanced Options: When both MongoDB and RDBMS are viable (significant SQL signals), both are suggested. When RDBMS is clearly better (isStrong), RDBMS is recommended. MongoDB is primary for right-fit and almost-right-fit use cases.
  • Modernization: When migration from RDBMS is selected, MongoDB AMP (AI-Driven Modernization) is included as a feature.
  • Reason Codes: These appear in exported recommendations and analytics tracking for identifying decision paths.

Rule Engine Documentation

Technical reference for the data-driven recommendation logic.

πŸ—οΈ Architecture

The system consists of two main components:

  • Rule Engine (RuleEngine): A generic engine that evaluates user answers against a set of rules.
  • Decision Rules (DECISION_RULES): An ordered list of rule objects defining the logic.

πŸ“ Rule Structure

Each rule is an object with the following properties:

{
    id: 'unique-rule-id',
    conditions: {
        [Q.USE_CASE]: 'iot',
        [Q.TRAFFIC_PATTERN]: ['large', 'massive']
    },
    result: { db: "MongoDB Atlas" }
}

Advanced Conditions

Conditions can also be a function for complex logic:

conditions: (answers) => {
    return answers[Q.USE_CASE] === 'iot' && someComplexCheck(answers);
}

βš™οΈ Enhancement Features

After rule evaluation, the system adds optional enhancements based on answered questions:

πŸ€– MongoDB AMP - AI Modernization (Q6)
If user selects "Yes" for migration (Q6), automatically adds MongoDB AMP (Application Modernization Platform) as a feature.
Features: Relational Migrator, App Modernization Services, AI-Driven schema transformation
πŸ—‚οΈ Sharding Guidance (Q13)
If user answers Q13 (Distribution), adds sharding strategy, shard key pattern, and use case guidance.
3 Strategies: Distributed (hashed), Location (geo), Range (time-series)
πŸ”‘ Access Pattern Optimization (Q16)
If user answers Q16 (Access Pattern), adds optimization strategy and actionable recommendations.
2 Patterns: Simple (key-value caching), Complex (indexes/aggregations)
⚑ Caching (Q17)
If Q16 = Simple AND Q17 = Sub-millisecond, recommends Redis + MongoDB for in-memory performance.
πŸ” Feature Detection (Q18)
Based on selected advanced features, automatically adds: Vector Search, Full-Text Search, Time Series Collections, Stream Processing, Mobile Sync partners.

πŸ”‘ SQL Constraint System (getSQLConstraints)

Many rules use getSQLConstraints(answers) to determine the appropriate recommendation tier. This returns an object with three key tiers:

Property Condition Recommendation
isStrong SQL-first AND (DB logic OR (heavy ACID + rigid schema)) RDBMS primary
hasSignificantSQLSignals SQL-first AND (heavy ACID OR rigid) but NOT isStrong Both suggested (MongoDB listed first)
isModerate SQL-first only (no strong data-model signals) MongoDB primary

Rules that use this system: sql-moderate, timeseries-universal, analytical-shallow-graph, analytical-realtime-*, transactional-shallow-graph, iot-massive, default, and the determinePrimaryDB fallbacks.

βž• How to Add a New Rule

  1. Open matrix.html
  2. Locate the DECISION_RULES array (search for "DECISION_RULES = [")
  3. Insert your new rule object in the correct position (order matters - more specific rules first!).
  4. Important: Add a corresponding handler in showRecommendationDirect() for the new rule's id.
⚠️ Rule + Handler Requirement
Every rule ID must have a matching handler in showRecommendationDirect(). Without it, the rule's reason code won't generate proper architecture/reasoning output.

πŸ“‹ Current Rules List (32 rules + 1 default)

🌊 Streams Processing
  • streams-processing
πŸ“± Mobile / Offline
  • mobile-offline
πŸ“Š Log Analytics
  • log-analytics (massive β†’ Search Engine)
  • log-analytics (moderate β†’ MongoDB + Atlas Search)
πŸ“‘ IoT / Time Series
  • iot-massive
  • iot-small-sql
  • timeseries-universal
πŸ€– Vector Search / AI
  • vector-search-massive (>100M vectors β†’ Dedicated)
  • vector-search-standard (β†’ Atlas Vector Search)
πŸ” Full-Text Search
  • fulltext-search-petabyte
  • fulltext-search-moderate
πŸ“ˆ Analytical Workloads
  • analytical-deep-graph (>5 hops β†’ Graph DB)
  • analytical-shallow-graph (β†’ MongoDB $graphLookup or RDBMS CTEs if significant SQL signals)
  • analytical-warehouse (β†’ Data Warehouse)
  • analytical-realtime-onprem
  • analytical-realtime-cloud
πŸ”— Transactional Graph
  • transactional-deep-graph (β†’ MongoDB + Graph DB)
  • transactional-shallow-graph (β†’ MongoDB or RDBMS CTEs if significant SQL signals)
πŸ—„οΈ SQL-First Team (7 rules)
  • sql-database-logic-large-scale
  • sql-database-logic
  • sql-modernization (β†’ MongoDB + AMP)
  • sql-heavy-acid-massive (β†’ Tiered: NewSQL OR MongoDB + Data Warehouse)
  • sql-heavy-acid-large (β†’ RDBMS with Option 1/2 comparison)
  • sql-heavy-acid (New app: RDBMS or MongoDB)
  • sql-moderate (β†’ MongoDB or Both, depending on ACID/schema signals)
πŸ’» Code-First / Structure
  • codefirst-document (β†’ MongoDB)
  • codefirst-rigid (β†’ MongoDB + Schema Validation)
πŸͺ Use Case Specific (6 rules)
  • saas-multitenant (SQL constraints aware)
  • ecommerce (SQL constraints aware)
  • cms-content (β†’ MongoDB flexible schema)
  • marketplace (SQL + scale aware)
  • social-network (Graph depth + SQL aware)
  • custom-explore (SQL constraints aware)
βš™οΈ Default Fallback
  • default (three-tier: isStrong β†’ RDBMS; significant signals β†’ both; else β†’ MongoDB)

πŸ“ Scale-Aware Decision Points

These rules adapt recommendations based on Q11 (Traffic Pattern):

Massive (PB) Tiered architecture required. No single DB handles PB efficiently.
Large (TB) Option 1/2 pattern: Scale RDBMS vs Modernize to MongoDB.
Small/Medium Standard recommendations. New apps: RDBMS or MongoDB both valid.

πŸ“Š Question Reference (Q Constants)

Question ID Purpose Impact
Use Case Q0 Primary use case selection πŸ”΄ High - triggers IoT, Logs, Mobile, SaaS, E-commerce rules
Workload Type Q1 Transactional vs Analytical πŸ”΄ High - determines workload path
Analytical Nuance Q2 Warehouse vs Real-time analytics 🟠 Medium - determines DW vs operational analytics
Team Skillset Q5 SQL-first vs Code-first πŸ”΄πŸ”΄ Critical - key input to getSQLConstraints()
Migration Status Q6 New app vs Modernization πŸ”΄ High - triggers AMP features, new app options
Business Logic Q8 App-tier vs Database (stored procs) πŸ”΄ High - input to isStrong; triggers sql-database-logic rules
ACID Needs Q9 Transaction requirements πŸ”΄ High - input to isStrong + hasSignificantSQLSignals
Normalization Q10 Rigid / Flexible / Optimizable schema πŸ”΄ High - input to isStrong + hasSignificantSQLSignals
Traffic Pattern Q11 Scale: Very Small β†’ Massive πŸ”΄πŸ”΄ Critical - determines tiered architecture
Distribution Q13 Sharding strategy 🟒 Enhancement - adds sharding guidance
Data Structure Q14 Document / Graph / Rigid 🟠 Medium - triggers graph + codefirst rules
Graph Depth Q15 Shallow (≀5 hops) vs Deep (>5 hops) 🟠 Medium - deep β†’ Graph DB; shallow β†’ $graphLookup
Access Pattern Q16 Simple lookups vs Complex queries 🟒 Enhancement - adds caching options
Latency Q17 Sub-millisecond requirement 🟒 Enhancement - adds Redis caching layer
Advanced Features Q18 Vector, Search, Streams, Time Series πŸ”΄ High - triggers specialized rules
Search Scale Q19 Full-text search workload size 🟠 Medium - petabyte β†’ dedicated search engine
Vector Scale Q20 Vector embedding count 🟠 Medium - >100M β†’ dedicated vector DB
Deployment Q21 Cloud vs On-premise 🟠 Medium - affects Atlas vs Enterprise naming
Security Q22 Standard vs Strict compliance 🟒 Enhancement - adds encryption features
Mobile Offline Q23 Offline-first requirements πŸ”΄ High - triggers mobile-offline rule
πŸ’‘ Removed Questions
Q7 (Migration Source) was removed - it only personalized text without affecting recommendations. Now we use generic "RDBMS (Oracle, SQL Server, PostgreSQL, MySQL)" messaging.