Skip to content

saebyn/pyecmc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

51 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pyecmc - A Python module that wraps python-memcached with AWS Elasticache autodiscovery.

Build Status

Introduction

Provides a ecmc.MemcacheClient class that uses AWS Elasticache autodiscovery to find all servers in the Elasticache cluster, proxy's memcache.Client from python-memcached, and uses hash_ring to provide consistent hashing to determine the correct server within the cluster for a given key even when servers are added or removed.

For detail on AWS Elasticache autodiscovery, please reference:

http://docs.aws.amazon.com/AmazonElastiCache/latest/UserGuide/AutoDiscovery.html

Installation

    $ pip install ecmc

Code example

    >>> from ecmc import MemcacheClient
    >>> mc = MemcacheClient('test.lwgyhw.cfg.usw2.cache.amazonaws.com:11211')
    >>> mc.set('foo', 'bar')
    True
    >>> mc.get('foo')
    'bar'

All methods available for memcached.Client from python-memcached are available on the MemcacheClient instance.

License

GNU LGPL v3. See the LICENSE file.

Most of this code came from https://github.com/yupeng820921/elasticache_pyclient .

About

A Python module that wraps python-memcached with AWS Elasticache autodiscovery.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages