TechnologyMay 3, 2022

Comparing Multi-Tenancy Features between Apache Pulsar and Kafka

Yabin Meng
Yabin MengDataStax
Comparing Multi-Tenancy Features between Apache Pulsar and Kafka
$ bin/pulsar tokens create \
--secret-key file:///path/to/token-generation-secret.key \
--expiry-time 1y \
--subject my-test-role
$ bin/pulsar-admin namespaces grant-permission my-tenant/my-namespace \
--role my-test-role \
--actions produce
superUserRoles=<list of role names>
$ pulsar-admin tenants create <tenant_name> \
--allowed-clusters <list of cluster names> \
--admin-roles <list of role names>
$ pulsar-admin namespaces grant-permission <tenant>/<namespace> \
--role <role_name> \
--actions [produce|consume|produce,consume]
$ pulsar-admin topics grant-permission persistent://<tenant>/<namespace>/<topic> \
--role <role_name> \
--actions [produce|consume|produce,consume]
$ pulsar-admin namespaces grant-subscription-permission <tenant>/<namespace> \
--roles <comma_separated_role_name_list> \
--subscription <subscription_name>
$ pulsar-admin topics set-publish-rate persistent://tenant/namespace/topic \
--byte-publish-rate <byte_rate_number> \
--msg-publish-rate <msg_rate_number> 
$ pulsar-admin resource-quotas set \
--namespace <namespace_name> \
--bundle <bundle_range> \
--bandwidthIn <incoming_message_bytes_number>
--bandwidthOut <outcoming_message_bytes_number> \
--msgRateIn <outcoming_message_number> \
--msgRateOut <incoming_message_number> \
--memory <message_usage_number> \
--dynamic <whether or not to allow dynamic re-calculation>
$ pulsar-admin namespaces set-publish-rate tenant/namespace \
--byte-publish-rate <byte_rate_number> \
--msg-publish-rate <msg_rate_number>
$ pulsar-admin topics set-max-producers persistent://tenant/namespace/topic \
--max-producers <producer_number> 
$ pulsar-admin namespaces set-max-consumers-per-topic tenant/namespace \
--max-consumers-per-topic <consumer_number> 
$ pulsar-admin ns-isolation-policy set <cluster_name> <policy_name> \
--namespaces <comma separated namespaces-regex list> \
--primary <comma separated primary-broker-regex list>
--secondary <comma separated secondary-broker-regex list>
-- <other options> …
$ pulsar-admin namespaces set-bookie-affinity-group <tenant>/<namespace> \
--primary-group <primary bookie group name> \
--secondary-group <secondary bookie group name>
$ pulsar-admin bookies set-bookie-rack \
--bookie <bookie address in format ‘address:port’) \
--hostname <bookie host name> \
--group <bookie group name> \
--rack <bookie rack name>
Discover more
Apache Kafka®DataStax

One-stop Data API for Production GenAI

Astra DB gives JavaScript developers a complete data API and out-of-the-box integrations that make it easier to build production RAG apps with high relevancy and low latency.