openresty / memc-nginx-module

An extended version of the standard memcached module that supports set, add, delete, and many more memcached commands.
http://wiki.nginx.org/NginxHttpMemcModule
213 stars 56 forks source link

support writing to multiple upstream servers ( sharding ) #31

Open helmus opened 6 years ago

helmus commented 6 years ago

It would be pretty awesome if memc could write to all upstreams on a cache miss, or support some function that will decide on a specific server based on crc of the key, this is how django works trough the python-memcached library example: python-memcached/memcache.py#L70

Right now a user will get as much caches misses as there are servers which is unfortunate.

An additional reason to support this is that memc currently will write to multiple upstream servers individually, but will not revoke the stale results on subsequent upstream writes, which may them result in stale cache hits, effectively making it impossible to use this lib with multiple upstream servers if stale hits are not acceptable.

somewhat related to #30 as this is a different solution ( maybe better ) for the same issue.