Each Tair (Redis OSS-compatible) instance is allocated a fixed number of 256 databases (DB0 to DB255) by default, and this number cannot be modified. Each database in a Tair instance does not have a separate memory usage limit. The amount of memory that each database can use is limited by the total available memory of the Tair instance. If you only use DB0, the other unused databases do not consume additional resources or affect performance.
You can run the SELECT command to switch between different databases. For example, you can run the following command to switch to DB10:
SELECT 10Tair (Redis OSS-compatible) cluster instances support multiple databases in both direct connection mode and proxy mode. We recommend that you use a proxy model to achieve better client compatibility. However, due to inherent limits, specific mainstream clients such as Jedis may not be able to use the SELECT command when they connect to cluster instances in direct connection mode.
We recommend that you prioritize using DB0 for data storage. Using multiple databases to isolate different business data is not recommended. Instead, we recommend that you create multiple Tair (Redis OSS-compatible) instances for resource-level isolation.