Our application has 1000+ tenants and we'd like to employ Redis Enterprise to dedicate a database to each of the tenants. Creating each tenant database using Redis Enterprise's admin portal is a tedious task for 1000+ tenants. What's the best way to create the databases in a batch? Any scripts or API to use to achieve this goal?
The Redis Enterprise REST API is pretty extensive. To create a DB just POST Application-json
with appropriate auth to https://<cluster_fqdn>:9443/v1/bdbs
"name": "testdb1",
"type": "redis",
"replication": true,
"memory_size": 100000000
}
Therefore you can bulk create DBs. The API has a lot of other useful endpoints at /v1/cluster
, /v1/nodes
, /v1/users
to name a few.
Just a note, you probably want to touch base with your contact at Redis Labs before doing this in production, there might be other details on your specific deployment. They can also point you in the right direction for how to better use the REST API which is supported but not fully documented publicly.