MongoDB
This page provides information on MongoDB's use and configuration in Cortex Fabric.
MongoDB Use Cases in Fabric
Fabric uses MongoDB to store internal state/resources via a configurable MongoDB URI.
While mongodbDB comes configured as a internal dependency in the Fabric Helm chart, externalizing MongoDB with Atlas to manage a replicated M40 cluster with User/Password Auth Encryption at rest and in transit is strongly recommended.
Configuration
Externalized configuration requires customers to obtain, install, and manage the MongoDB Atlas instance and connection URI.
Example MongoDB configuration for the Fabric Helm Chart:
cortex: mongodb: # cortex.mongodb.username: The Mongodb admin username, will be generated if left blank username: "mongo" # cortex.mongodb.password: The Mongodb admin password, will be generated if left blank password: "" replicaSetKey: "mongodb" # cortex.mongodb.mongoUri: The mongodb uri to used by cortex services mongoUri: "mongodb://$(MONGODB_USERNAME):$(MONGODB_PASSWORD)@cortex-mongodb-headless.cortex.svc.cluster.local:27017/cortex_services?authSource=cortex_services&replicaSet=rs0" # cortex.mongodb.database: Cortex api service needs the database specified separately database: "cortex_services"
Sizing Recommendations
See the Dependencies Table for version requirements for Mongo in your Fabric build.
In general CognitiveScale recommends using a SaaS based MongoDB instance (such as Atlas), given the needs for scaling, support, upgrades and maintenance, with 50 GB per replica PVC.
Specifically for GCP installations, the recommendation is to configure a standard Mongo Atlas M40 Cluster with the following:
- 80GB storage
- 16GB RAM
- 4vCPUs