Skip to content

Discussion: On the Possibility of Changing Maxwell's Code Organization #2213

@guxingke

Description

@guxingke

Background

Maxwell is an excellent tool for capturing and distributing MySQL binlog changes. Currently, Maxwell's core logic and various producers are tightly coupled within a single codebase. While it is technically possible to integrate Maxwell as a library, the current monolithic package pulls in a large number of unnecessary dependencies, which increases the complexity of integration and maintenance. This forces any project that wants to use its core functionality to either run a full Maxwell daemon or integrate a bulky library with redundant features.

An Idea

I have an idea about adjusting Maxwell's code organization and would like to consult and discuss its feasibility with the project maintainers.

My idea is to restructure the Maxwell codebase into a modular architecture without changing the current distribution method. Specifically, we could:

  1. Create a maxwell-core module: This module would contain only the code for binlog parsing, change capture, and core routing logic. It would be very lean and would not include any specific producer implementations.
  2. Create separate producer modules: For example, maxwell-producer-kafka, maxwell-producer-rabbitmq, etc. These modules would depend on maxwell-core.

The Benefits of This Change

  • Lighter and more focused: The maxwell-core module would focus solely on its core tasks. When used as a library, it would no longer pass on unnecessary dependencies, greatly reducing project complexity.
  • Greater flexibility: Other projects could easily integrate the streamlined maxwell-core into their own code and directly call its core functions without needing to run a separate Maxwell daemon.
  • Encourages innovation: The community could more easily develop and contribute new producer modules or create custom data processing logic without modifying the core codebase.

I understand this adjustment might require some effort, but in the long run, it would significantly improve Maxwell's flexibility and extensibility.

I'm curious to hear your thoughts on this and whether such a change is on the roadmap for the future. I look forward to your reply.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions