MongoDB Database Links (*-mongo_db)

Links to MongoDB mongo_db sub-components provide document database access with auto-generated connection configuration

🍃 What These Links Do

Inject MongoDB connection URI into environment
Configure database-specific credentials
Set database name and auth database
Enable replica set connection (for HA)

🔗 Supported Link Types

Link Type Use Case Generated Files
image_base-mongo_db Base application MongoDB access 📁 src/mongodb_module/
fastapi-mongo_db FastAPI document storage 📁 src/mongodb_module/
python-mongo_db Python application MongoDB 📁 src/mongodb_module/
nodejs-mongo_db Node.js document storage 📁 src/mongodb/
k6-mongo_db Load testing with MongoDB 📄 configmap.yaml
keda-mongo_db Query-based autoscaling 📄 scaledobject.yaml
topic-mongo_db Kafka → MongoDB sink 📄 connector.yaml

⚙️ Generated Environment Variables

# Automatically configured when you create a MongoDB link
MONGODB_HOST=auto-configured
MONGODB_PORT=27017
MONGODB_DATABASE={database_name}
MONGODB_USERNAME={database_user}
MONGODB_PASSWORD={database_password}
MONGODB_AUTH_SOURCE=admin
MONGODB_URI=mongodb://{user}:{password}@{host}:{port}/{db}?authSource=admin

📈 KEDA MongoDB Scaling (keda-mongo_db)

When KEDA links to a MongoDB database, it creates a ScaledObject for query-based scaling:

Attribute Description Example
keda_query MongoDB query (JSON format) {"status": "pending"}
keda_collection Target collection for query tasks
keda_query_value Threshold value to trigger scaling 10

🔀 Shard Links

mongo_db-shard

Assign database to specific shard in sharded clusters

💾 Backup Links

mongodb-bucket
mongodb-swbucket

Automated backups to MinIO or SeaweedFS