Uploaded image for project: 'Debezium'
  1. Debezium
  2. DBZ-5113

MongoDB Connector should use RawBsonDocument instead of Document

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Done
    • Icon: Major Major
    • 2.0.0.Alpha2
    • None
    • mongodb-connector
    • None
    • False
    • None
    • False

      When we use oplog capture mode, we convert the oplog into a Document https://github.com/debezium/debezium/blob/main/debezium-connector-mongodb/src/main/java/io/debezium/connector/mongodb/MongoDbStreamingChangeEventSource.java#L198-L199

      Similar for change stream API https://github.com/debezium/debezium/blob/main/debezium-connector-mongodb/src/main/java/io/debezium/connector/mongodb/MongoDbStreamingChangeEventSource.java#L311-L312

      This implies a deserialization on every event from raw bytes into bson.Document. Is there any reason we are not considering using `RawBsonDocument` directly for efficiency type-safety reason?

       

      edit: I realized RawBsonDocument itself is still a BSON document, which means there will be no efficiency gain but mostly for type-safe and extensibility

            Unassigned Unassigned
            ywu-stripe Yang Wu (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: