- https://www.mongodb.com/docs/
- https://www.mongodb.com/docs/manual/reference/connection-string/
- https://www.mongodb.com/docs/manual/reference/method/db.collection.insertOne/
- Schema-flexible persistence of JSON-like event structures
- Real-time, one-to-one event ingestion into MongoDB collections
- Support for secure and authenticated database access
- Seamless compatibility with MongoDB Atlas and on-prem setups
- Events are streamed to the configured Kafka-native topic.
- The connector reads each event and treats it as a document.
- Using the provided credentials, it connects to the specified MongoDB host and database.
- It inserts each event as a new document into the configured collection.
- Condense manages retries, observability, and operational isolation.
Field-by-Field Explanation
1. Title
- What It Is: Unique connector name for identifying and managing this integration in Condense.
- Best Practice: Use a name that maps to its role, such as
mongodb-user-tracking-store.
2. Host URL
- What It Is: Full MongoDB connection string (including protocol, host, port, and optional query parameters).
- Format Example:
- Atlas Tip: For MongoDB Atlas, use the connection URI provided in the Atlas dashboard.
3. Database
- What It Is: Logical database name inside the MongoDB cluster.
- Example:
iot_logs,user_analytics,app_events
4. Collection Name
- What It Is: The collection where each event is stored as a document.
- Note: The connector creates the collection automatically if it does not exist.
5. Username
- What It Is: Database user with write access to the target collection.
- Role Requirement: The user must have insert privileges on the target database and collection.
6. Password
- Description: Password associated with the MongoDB user.
- Required: Only if MongoDB authentication is enabled.
- Best Practice: Store credentials securely and rotate them periodically.
7. Topic (Input)
- What It Is: Kafka-native topic in Condense from which messages are consumed.
- Usage: Messages should be valid JSON objects or JSON strings that can be converted into MongoDB documents.
- Symptom: MongoDB returns an access denied error.
- Fix: Ensure the username and password are correct and the user has write access to the target database and collection.
- Symptom: Some events fail to store.
- Fix: Validate JSON structure. MongoDB BSON has document size and nesting limits.
- Symptom: Unable to connect to MongoDB.
- Fix: Verify the host, port, firewall rules, network connectivity, and MongoDB cluster availability.
- Symptom: Error indicating the target collection does not exist.
- Fix: Pre-create the collection or ensure the user has permission to create collections.
- Symptom: Slow event ingestion.
- Fix: Optimize indexes, review write concern settings, and monitor MongoDB performance.
- MongoDB is schema-flexible, but maintaining a consistent document structure improves querying and analytics.
- If the incoming document does not contain an
_idfield, MongoDB automatically generates one.
- Future versions may support
bulkWriteorreplaceOnewith_idfor update and upsert scenarios.
- For production deployments on MongoDB Atlas, configure VPC peering or Private Endpoints for secure connectivity.
- MongoDB enforces a maximum document size of 16 MB. Large payloads should be split before publishing.
- Validate JSON payloads before publishing them to MongoDB.
- Use TTL indexes to automatically expire historical documents where appropriate.
- Avoid deeply nested document structures unless required.
- Monitor connector health using Condense observability and MongoDB monitoring tools.
- Keep MongoDB server and driver versions updated for performance and security.