zenpy icon indicating copy to clipboard operation
zenpy copied to clipboard

[Feature Request] zenpy to support cache backends

Open akalex opened this issue 1 year ago • 4 comments

In the era of distributed systems and cloud-native applications, Storing cache not in process memory but in some external backends like Redis, Memcached, and even databases would be very beneficial. Have you ever considered adding support for cache backends?

akalex avatar Oct 23 '23 07:10 akalex

A good first step is to abstract the notion of a cache. And then we can implement various implementations of that interface. Let's first analyze how the cache is being

  1. defined
  2. implemented
  3. used And then we can come up with an appropriate abstraction and configuration method.

cryptomail avatar Oct 23 '23 20:10 cryptomail

I would rather start with a problem than with use cases. The problem is that if my application runs in more than one instance then using cache in its current implementation nullifies all benefits and even more it can become a huge headache.

akalex avatar Oct 24 '23 07:10 akalex

Agreed, so a first step could be abstracting what the current caching system does and then make a "pluggable" replacement system. Have you looked at the internals of the existing cache and considered making an interface-conforming drop in replacement?

cryptomail avatar Oct 24 '23 15:10 cryptomail

I have looked a little bit. Let me take a deeper look to come up with some ideas.

akalex avatar Oct 24 '23 16:10 akalex