Overview
Mongezium is a CDC (Change Data Capture) application from MongoDB to Kafka. It can be used to track changes in a set of MongoDB collection and broadcast events to downstream consumers.
Common use cases for this application include:
- Data Replication: Clone and/or Import/Export of a MongoDB collection.
- Event Sourcing: Capture changes in a MongoDB collection and push them to a Kafka topic.
- Aggregation: Prepare collection documents for aggregation with other data sources.
Internally Mongezium uses MongoDB change streams to listen for changes in the collections and maps MongoDB events into schemaless Debezium-like messages.
Mongezium recognize 4 different types of events:
- create as
c
: corresponding to MongoDBcreate
event - read as
r
: corresponding to MongoDBreplace
event or to an initial snapshot - update as
u
: corresponding to MongoDBupdate
event - delete as
d
: corresponding to MongoDBdelete
event
Mongezium can be configured with different startup behaviors, such as performing always an initial snapshot on startup, or resuming the change stream from the last known resume token.
Mongezium stores its state (Mongodb collection oplog.rs
) in the production output topic using Kafka headers.