Skip to content

Latest commit

 

History

History
58 lines (32 loc) · 3.8 KB

File metadata and controls

58 lines (32 loc) · 3.8 KB
graph LR
    Client_API_Base_Client_["Client API (Base Client)"]
    Hashing_Routing_Hash_Client_["Hashing/Routing (Hash Client)"]
    Retry_Mechanism_Retrying_Client_["Retry Mechanism (Retrying Client)"]
    AWS_ElastiCache_Extension["AWS ElastiCache Extension"]
    Hashing_Routing_Hash_Client_ -- "manages" --> Client_API_Base_Client_
    Retry_Mechanism_Retrying_Client_ -- "wraps" --> Client_API_Base_Client_
    Retry_Mechanism_Retrying_Client_ -- "wraps" --> Hashing_Routing_Hash_Client_
    AWS_ElastiCache_Extension -- "extends" --> Hashing_Routing_Hash_Client_
    AWS_ElastiCache_Extension -- "uses" --> Client_API_Base_Client_
Loading

CodeBoardingDemoContact

Details

The Client Wrappers & Extensions subsystem in pymemcache provides enhanced client functionalities by building upon core client implementations. This design adheres to the "Extension/Plugin Architecture" and "Decorator Pattern" to add features like fault tolerance and dynamic cloud environment integration without altering the fundamental client logic.

Client API (Base Client)

This is the foundational component, representing the basic interface for interacting with a single Memcached server. It encapsulates the direct network communication, handles socket operations, and implements the core Memcached protocol commands (e.g., set, get, delete). It also manages serialization and deserialization of data.

Related Classes/Methods:

Hashing/Routing (Hash Client)

This component extends the capabilities of the Base Client to manage interactions with multiple Memcached servers, forming a cluster. It employs a hashing algorithm (like Rendezvous Hash) to determine which server a given key should be routed to. It also incorporates basic mechanisms for handling server failures and retrying operations within the cluster.

Related Classes/Methods:

Retry Mechanism (Retrying Client)

This component acts as a wrapper (following the decorator pattern) around any other client (e.g., Base Client or Hash Client) to introduce automatic retry logic. It intercepts client calls and, in case of specified exceptions (e.g., network issues), re-attempts the operation a configurable number of times with a delay.

Related Classes/Methods:

AWS ElastiCache Extension

This specialized client is built upon the Hash Client and provides dynamic node discovery and management specifically for AWS ElastiCache clusters. It automates the process of identifying and connecting to cluster nodes by querying the ElastiCache configuration endpoint, eliminating the need for manual configuration updates when the cluster scales or changes.

Related Classes/Methods: