Hello đź‘‹, I'm using the postgres source connector to capture changes from a very high traffic postgres database. The throughput is more than a single connector can handle, so I need to run multiple connectors with a subset of the tables being handled by each connector. The problem is each connector instance needs to have a unique topic.prefix configured (as perÂ
https://debezium.io/documentation/reference/stable/connectors/postgresql.html#postgresql-property-topic-prefix )....which is kind of unfortunate because then all the sinks/consumers are affected whenever we change how the tables are partitioned across the source connectors. We'd rather all tables be published to a unified prefix regardless of which connector instance is sourcing the data.Â
I'm fairly new to debezium so I'd appreciate any advice if there is a known/common way to accomplish this. If not, I'd be happy to submit a PR to allow this, any advice on the direction to take and/or gotchas to watch out for? Thanks!
High level approach ideas I had:
1. Simple and straight-forward: provide a new configuration value to explicitly provide an overridden value for the usages where "topic.prefix" is being used as some sort of internal key. When this new config value is provided "topic.prefix" is only used to form the kafka topic. Using this approach, the multiple connector instances would need to be configured and managed manually.
2. Complex and fancy: Theoretically we could support "tasks.max" values greater than "1". If you specified a "tasks.max" value of "3" it would create 3 replication slots and generate the publications such that the tables are evenly balanced across the 3. This way there is still only a single connector, but it could handle far more throughput than it currently does. Conceptually this makes sense in my head, but I have no idea how feasible it is from a technical perspective. I have next-to-zero knowledge about the internal architecture of the connector at this point, so it could be completely unrealistic.
Any insights/advice are appreciated, Thanks!
- Chris