# Distributed Redis Architecture



The distributed Redis adpots a Proxy + Redis sharding architecture. The proxy supports only standalone Redis, while Redis shards in the cluster can be used without a proxy, but only in a native cluster mode. The usage method should be selected according to the type of client (for command limits, refer to the FAQs).
Redis sharding is based on the master-replica version of the Redis resource pool, effectively breaking through the single-threaded bottleneck inherent in Redis. It supports online expansion, which can significantly meet the business requirements for large capacity or high performance in Redis.

#### 1. Distributed Redis Architecture

<!-- image-todo -->

Each Redis shard in the distributed Redis setup is a master-replica version of Redis that shares a resource pool with the master-replica version of Redis. Its architecture is identical to the high-availability architecture of the master-replica version of Redis. The capacity limitations and the rules for expansion and contraction of a single shard are consistent with those of the master-replica version of Redis.
The proxy for distributed Redis is designed with high availability in mind. The container-based proxy will be automatically migrated to other hosts by the system in the event of a host failure. The Kuaijie-based proxy consists of one master and one backup host, and the high-availability IP will be migrated to the backup host by the system after the master fails.

#### 2. Configuration Mode of Distributed Redis Proxy

<!-- image-todo -->
The master-replica type proxy offers an IP gateway for each proxy, and users can freely configure the proxy gateway.


<!-- image-todo -->
Under the load-balancing proxy mode, the cluster provides only one IP gateway. Business requests are sent to ULB4, and ULB4 Server performs failed-down and request balancing.

#### 3. Internal Architecture of Distributed Redis Proxy

<!-- image-todo -->

The internal architecture of Distributed Redis Proxy is composed of multiple Proxy processes (Redis Proxy). The system kernel balances client connections and binds them to a specific Proxy process. 
Within the Distributed Redis Proxy, there is one process (BusyProxy) that handles multi-key commands to process complex queries.

The Distributed Redis cluster employs a multi-Redis node architecture, where each single node is based on the master-replica version of the Redis resource pool. Backup nodes maintain high availability, allowing the system to easily overcome the single-threaded bottleneck of Redis itself. This architecture supports online expansion, which can significantly meet the business needs for large capacity or high performance in Redis..
