How to achieve multi-tenancy in the context of Kafka and storm?

守給你的承諾、 提交于 2019-12-03 11:12:19

I think that topic for each tenant is the right choice.

The naming convention might be something like this: topic_base_name_tenant_id.

The reasons are:

  1. It allows flexible configuration for each tenant (like @Sebastian mentioned earlier).
  2. Clearer logical separation.

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

  1. You are limiting the parallelism level to the number of tenants.
  2. Adding new tenants, results adding new partition → republish old messages (The default partitioning algorithm is: message_key % partition_size).

Sometimes you may need multiple topics per application. In that case you could follow the following topic naming convention: topic_base_name_tenant_id. So for a given base topic, you will have as many topics as the number of tenants

Don't consider my answer as the "best practice" because I'm not Kafka expert, but in case it helps: we faced a similar design scenario (one Kafka endpoint available to multiple teams that acts as a central point for event creation and routing). After pondering different alternatives, we decided what you suggest: to have one topic per application (you could say tenant), customizing the topic (partition, limits, etc.) according to the application needs.

Hope this helps.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!