pip/pip-11.md
Pulsar was designed as a multi-tenant system from the very beginning. From this it originate the notions of tenants and namespaces to allow users to administrate and operate their own topics.
In Pulsar, all these concepts are explicitly set in the namespace and topic names.
The topic name is composed of all the names:
persistent://my-tenant/my-cluster/my-namespace/my-topic
In PIP-10, we have already introduced the proposal to hide the cluster name from the topic name, resulting in a topic name such as:
persistent://my-tenant/my-namespace/my-topic
This proposal is dependent on PIP-10 because it needs the cluster to not appear in the topic name.
In many cases, when deploying Pulsar as a single tenant, users might not need all the "tenant" and "namespace" information, but currently it would have to do the following steps after deploying a Pulsar cluster, even when authorization is not required:
Additionally, it forces the multi-tenant model even when it's not needed or when someone wants to just "play" with the system.
For such reasons, this proposal is to introduce a default namespace that is always pre-created and a short notation for topic names.
For example:
my-topic --> persistent://public/default/my-topicIf omitted, the persistent or non-persistent schema, will be defaulted to
persistent, even when using longer form of topic name:
tenant/namespace/my-topic --> persistent://tenant/namespace/my-topicThe goal is to be able to use the short form in client API and tools:
PulsarClient client = PulsarClient.create("pulsar://localhost:6650");
Producer producer = client.createProducer("my-topic");
producer.send(message);
At the same time, all CLI tools will recognize the short notation as well, for example:
$ bin/pulsar-admin persistent stats my-topic
It will be equivalent to:
$ bin/pulsar-admin persistent stats persistent://public/default/my-topic
The changes will be mostly on the surface:
public tenant (property). This tenant will be
already pre-created when initializing a Pulsar cluster. When authorization
is enabled, it would be responsibility of the administrator to grant
permissions to use it.public/default namespace. This will be pre-created
at the cluster initialization. The default namespace will be a regular
namespace that the administrator can configure in the same way as all other
namespacesmy-topic --> persistent://public/default/my-topic