Skip to content

Ask the HotKV docs

Answers come only from these docs and can be wrong; check the linked pages before you rely on them.

TENANT.CREATE

Last updated
TENANT.CREATE id name [MAX_MEMORY bytes] [MAX_KEYS count] [MAX_CONNECTIONS count] [MAX_COMMANDS_SEC count] [MAX_DATABASES count] [MAX_EGRESS bytes]
Group
Tenancy
Complexity
O(1)
Arity
-3 (at least 3 words, counting the command name)
Flags
admin, write
HotKV Cloud
Scale
On-Premise
requires the multi-tenancy license feature

TENANT.CREATE adds a tenant to the server’s tenant registry. A tenant has an ID, a display name, a state (active when created), a set of quota values and a list of bound users (see TENANT.BIND). The registry is the same on every node of a cluster: a change made on one node reaches the others, and it is saved with the data and replicated.

A server holds up to 256 tenants.

Option Meaning Default
MAX_MEMORY bytes Memory limit 0 (unlimited)
MAX_KEYS count Key limit 0 (unlimited)
MAX_CONNECTIONS count Connection limit 0 (unlimited)
MAX_COMMANDS_SEC count Commands per second 0 (unlimited)
MAX_DATABASES count Databases 16
MAX_EGRESS bytes Outgoing traffic limit 0 (unlimited)

Option names are not case sensitive. A value that is not a non-negative integer is ignored and the default stays, and so are unknown options.

Simple string OK in RESP2 and RESP3, or one of these errors:

Case Error
The ID exists, or 256 tenants already exist ERR tenant already exists or limit reached
A limit value that is not a number ERR invalid OPTION value, with the option’s name, for example ERR invalid MAX_KEYS value
An option the command does not know ERR unknown option 'name'
An option without a value ERR syntax error
No license that includes multi-tenancy NOLICENSE multi-tenancy requires a HotKV license. Contact sales@hotkv.com

In each of these cases the tenant is not created.

127.0.0.1:6379> TENANT.CREATE acme "Acme Corp" MAX_MEMORY 1073741824 MAX_KEYS 1000000
OK
127.0.0.1:6379> TENANT.CREATE acme "Acme again"
(error) ERR tenant already exists or limit reached

HotKV-only command.

TENANT.INFO, TENANT.BIND, TENANT.DROP, TENANT.LIST