如何在卡夫卡和风暴背景下实现多租户? [英] How to achieve multi-tenancy in the context of Kafka and storm?
本文介绍了如何在卡夫卡和风暴背景下实现多租户?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在Kafka和Storm的背景下构建多租户应用的最佳实践是什么?
What are the best practices, for building a multi-tenant app in the context of Kafka and storm?
例如:为每个租户创建主题并使用多主题喷口(使用通配符).
For example: creating topic for each tenant and consume multi-topics spout (using wildcard).
推荐答案
我认为每个租户的主题都是正确的选择.
命名约定可能类似于: topic_base_name_tenant_id .
The naming convention might be something like this: topic_base_name_tenant_id.
原因是:
- 它允许为每个租户进行灵活的配置(例如前面提到的@Sebastian).
- 更清晰的逻辑分离.
现在让我们说我们将使用不同的方法.例如,为每个租户分配分区.可能有问题,因为:
Now let's say that we will use different approach. For example, partition for each tenant. It might be problematic, since:
- 您将并行度级别限制为租户数量.
- 添加新租户,结果添加新分区→重新发布旧消息(默认分区算法为:message_key%partition_size).
这篇关于如何在卡夫卡和风暴背景下实现多租户?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文