简体   繁体   English

为多个 Kafka 主题重用一个模式

[英]Reuse one schema for multiple Kafka topics

I tried to search for this, but my results are always flooded with "multiple schemas per Kafka topic" entries.我试图搜索这个,但我的结果总是充斥着“每个 Kafka 主题的多个模式”条目。 I'd like to know the other way round, if it may be problematic or if I could expect issues with reusing the same schema for different Kafka topics?我想知道反过来,如果它可能有问题,或者我是否可以预期为不同的 Kafka 主题重用相同的模式会出现问题? They definitely have to be different topics for my use case (while they must always have the same schema), but I don't know if I would violate some hidden semantic relationship between schema name and topic name.对于我的用例,它们肯定必须是不同的主题(虽然它们必须始终具有相同的架构),但我不知道我是否会违反架构名称和主题名称之间的某些隐藏语义关系。 Would this "only" break conventions or lead to actual problems?这是否会“仅”打破惯例或导致实际问题?

Assuming you're using the Confluent Schema Registry, then each topic is a unique subject, but the schemas can indeed be shared since matching schemas would generate matching ids.假设您正在使用 Confluent Schema Registry,那么每个主题都是一个独特的主题,但模式确实可以共享,因为匹配的模式会生成匹配的 id。

This isn't a problem and saves storage on the brokers by not storing duplicate information这不是问题,并且通过不存储重复信息节省了代理的存储空间

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

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