Skip to content

Latest commit

 

History

History
90 lines (59 loc) · 7.6 KB

File metadata and controls

90 lines (59 loc) · 7.6 KB
graph LR
    Connection_Abstraction["Connection Abstraction"]
    Connection_Pooling["Connection Pooling"]
    Sentinel_Integration["Sentinel Integration"]
    Cluster_Integration["Cluster Integration"]
    Exception_Handling["Exception Handling"]
    Connection_Abstraction -- "uses" --> Exception_Handling
    Connection_Pooling -- "uses" --> Connection_Abstraction
    Sentinel_Integration -- "relies on" --> Connection_Pooling
    Sentinel_Integration -- "uses" --> Exception_Handling
    Cluster_Integration -- "relies on" --> Connection_Pooling
    Cluster_Integration -- "uses" --> Exception_Handling
Loading

CodeBoardingDemoContact

Details

The Connection Management subsystem in redis-py is crucial for establishing and maintaining connections to various Redis deployments. It abstracts the complexities of network communication, connection pooling, and handling different Redis topologies (standalone, Sentinel, Cluster).

Connection Abstraction

This component provides the foundational classes for managing individual connections to a Redis server. It handles the low-level details of establishing TCP or Unix socket connections, sending commands, and receiving responses. It also includes support for SSL/TLS connections.

Related Classes/Methods:

Connection Pooling

This component manages a pool of connections to Redis, improving performance by reusing existing connections instead of establishing new ones for each operation. It handles connection lifecycle, including creation, release, and optional blocking behavior when the pool is exhausted.

Related Classes/Methods:

Sentinel Integration

This component provides support for connecting to and managing Redis Sentinel deployments. It enables the client to discover the current master and replica nodes, handle failovers, and automatically re-route commands to the correct master.

Related Classes/Methods:

Cluster Integration

This component handles connections and command routing within a Redis Cluster environment. It manages slot mapping, handles redirection errors (MOVED/ASK), and discovers cluster nodes, ensuring commands are sent to the appropriate shard.

Related Classes/Methods:

Exception Handling

This component defines a hierarchy of custom exceptions specific to Redis operations and connection issues. It provides a structured way to handle errors such as connection failures, timeouts, authentication errors, and Redis-specific response errors.

Related Classes/Methods: