简体   繁体   English

Kafka Connect:单个连接器或每个表连接器的方法

[英]Kafka Connect: Single connector or connector per table approach

I have a database say test and we are having multiple Kafka Debezium Connectors on it.我有一个数据库说测试,我们有多个 Kafka Debezium 连接器。 Each connector is associate with one table.每个连接器都与一个表相关联。

My question is in terms of memory usage, which is a better approach:我的问题是关于 memory 的用法,这是一种更好的方法:

  1. One connector per database OR每个数据库一个连接器或
  2. One connector per table每桌一个连接器

Considering all performance factors, it is always a recommended approach to have a single source connector (multiple instances to share the load), with replicator or configuration file per database instance (test1, test2, test3 etc), having multiple tables, so the data ingress would be 1 table -> 1 topic .考虑到所有性能因素,始终推荐使用单个源连接器(多个实例来分担负载)、每个数据库实例(test1、test2、test3 等)具有复制器或配置文件,具有多个表,因此数据入口将是1 个表 -> 1 个主题

You can have a better view at Oracle Golden Gate implementation pattern for the same.您可以在 Oracle Golden Gate implementation pattern 中获得更好的视图。

https://rmoff.net/2018/12/12/streaming-data-from-oracle-into-kafka/ https://rmoff.net/2018/12/12/streaming-data-from-oracle-into-kafka/

I think it really depends on your use case.我认为这真的取决于你的用例。 I don't think there is a general approach for all the usecases.我认为没有适用于所有用例的通用方法。 For example, at my current job, we decided to have 4 connectors that stream changes from the same database, but, each of them is streaming from a subset of tables.例如,在我目前的工作中,我们决定让 stream 从同一个数据库更改的 4 个连接器,但是,它们中的每一个都从表的子集流式传输。 The main reason is that we don't want to have a single point of failure where a bad record inside DB can break all our usecases that rely on CDC, hence, we divided the tables and assigned them to a connector.主要原因是我们不希望出现单点故障,因为 DB 中的错误记录会破坏我们所有依赖 CDC 的用例,因此,我们划分了表并将它们分配给连接器。 Note that it's not good to have a lot of replication slots on the database also.请注意,在数据库上也有很多复制槽也是不好的。 So it really depends on your usecase.所以这真的取决于你的用例。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM