在Kafka和storm的背景下如何实现多租户? [英] How to achieve multi-tenancy in the context of Kafka and storm?

查看:22
本文介绍了在Kafka和storm的背景下如何实现多租户?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在 Kafka 和 Storm 的上下文中构建多租户应用程序的最佳实践是什么?

What are the best practices, for building a multi-tenant app in the context of Kafka and storm?

例如:为每个租户创建主题并使用多主题 spout(使用通配符).

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.

原因是:

  1. 它允许为每个租户灵活配置(如前面提到的@Sebastian).
  2. 更清晰的逻辑分离.

现在假设我们将使用不同的方法.例如,为每个租户分区.这可能有问题,因为:

Now let's say that we will use different approach. For example, partition for each tenant. It might be problematic, since:

  1. 您将并行级别限制为租户数量.
  2. 添加新租户,结果添加新分区→重新发布旧消息(默认分区算法为:message_key % partition_size).

这篇关于在Kafka和storm的背景下如何实现多租户?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆