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

MongoDB Connector should use RawBsonDocument instead of Document

    XMLWordPrintable

Details

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

    Description

      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

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: