graph LR
Client_API["Client API"]
Connection_Management["Connection Management"]
Protocol_Command_Handling["Protocol & Command Handling"]
Utility_Cross_Cutting_Concerns["Utility & Cross-Cutting Concerns"]
Client_API -- "interacts with" --> Connection_Management
Client_API -- "uses" --> Protocol_Command_Handling
Connection_Management -- "provides connections to" --> Client_API
Connection_Management -- "leverages" --> Utility_Cross_Cutting_Concerns
Protocol_Command_Handling -- "used by" --> Client_API
Protocol_Command_Handling -- "used by" --> Connection_Management
Utility_Cross_Cutting_Concerns -- "supports" --> Client_API
Utility_Cross_Cutting_Concerns -- "supports" --> Connection_Management
click Client_API href "https://github.com/CodeBoarding/GeneratedOnBoardings/blob/main/redis-py/Client_API.md" "Details"
click Connection_Management href "https://github.com/CodeBoarding/GeneratedOnBoardings/blob/main/redis-py/Connection_Management.md" "Details"
click Protocol_Command_Handling href "https://github.com/CodeBoarding/GeneratedOnBoardings/blob/main/redis-py/Protocol_Command_Handling.md" "Details"
click Utility_Cross_Cutting_Concerns href "https://github.com/CodeBoarding/GeneratedOnBoardings/blob/main/redis-py/Utility_Cross_Cutting_Concerns.md" "Details"
The redis-py library is designed with a clear layered architecture, where the Client API acts as the primary facade for users. This API delegates connection management to the Connection Management layer, which in turn relies on the Protocol & Command Handling layer for data serialization and deserialization. Various Utility & Cross-Cutting Concerns provide essential supporting services across these layers, ensuring robustness, security, and efficiency.
Client API [Expand]
The primary interface for users to interact with Redis. It provides high-level methods for executing Redis commands, managing command pipelines, and handling transactions. It supports both synchronous and asynchronous operations, abstracting the underlying network communication.
Related Classes/Methods:
Connection Management [Expand]
Responsible for establishing, maintaining, and pooling connections to various Redis deployments (standalone, Sentinel, Cluster). It handles connection lifecycle, including retries, error handling, and routing commands to appropriate nodes based on the deployment type.
Related Classes/Methods:
redis.connection(1:1)redis.asyncio.connection(1:1)redis.sentinel(1:1)redis.asyncio.sentinel(1:1)redis.cluster(1:1)redis.asyncio.cluster(1:1)
Protocol & Command Handling [Expand]
Encapsulates the logic for converting Python data into the Redis Serialization Protocol (RESP) format for outgoing commands and parsing RESP responses back into Python data types. It also defines the structure and arguments for all Redis commands, including specialized module commands (e.g., RedisJSON, RediSearch).
Related Classes/Methods:
redis._parsers.base(1:1)redis._parsers.hiredis(1:1)redis._parsers.resp2(1:1)redis._parsers.resp3(1:1)redis._parsers.encoders(1:1)redis.commands.core(1:1)redis.commands.bf(1:1)redis.commands.json(1:1)redis.commands.search(1:1)redis.commands.timeseries(1:1)redis.commands.vectorset(1:1)
Utility & Cross-Cutting Concerns [Expand]
A collection of foundational services and common utilities that support the core functionality of the library. This includes authentication mechanisms, robust error handling, retry strategies, an internal event system, caching, and distributed synchronization primitives like locks.
Related Classes/Methods: