简体   繁体   中英

How to scale Redis?

I have a single instance Redis deployment, and my application uses multiple databases within that deployment.

I would like to scale it up, however, the issue is, RedisCluster does not support multiple databases. What are my best options?

You've only two options:

  1. You refactor your application layer to use sharding (ie Redis Cluster ).
  2. You use regular master-slave replication to load balance your Redis work load.

Actually, IIUC, you have another option (besides the two that @Matias put) - stop using shared databases and, instead, spin up a dedicated Redis server process for each database.

If your server has more than 2 CPU cores, this will allow you to utilize them better. In your application(s) code, replace calls to SELECT with a connection to the relevant Redis server.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM