ella/ella — Issue #75: Move Listings to Redis
Author: HonzaKral
Created: 2012-02-14 01:11:55+00:00
State: open
Labels: cleanup, proposal

I am going to add a "caching layer" on top of existing Listings mechanism by storing the listings in Redis. The idea is to store the listings for each category as a ZSET to allow for more efficient DB handling. Proposed workflow:

* on listing save insert the publishable ID into all appropriate zset (`category:2:all`, `category:2:articles`, `category:1:children:all`, `category:1:children:articles`) with the score being the publish_from of the listing as a unix timestamp
* on update of Listing (`publish_from`), delete of listing and/or change of publishable's `published` flag, update the zsets accordingly
* when displaying a list, just slice the zset in redis to get the PKs and use new function `get_cached_objects` that will just do a get_multiple request to cache and then optionally suplement it from the DB
* ...
* profit

I will do this as an optional feature for now (including a migration) dependent on settings (much like the use of redis in `ella.photos`)