Incorporating redis database in the mediadrop stack

12 views
Skip to first unread message

Adam Morris

unread,
Dec 18, 2013, 4:54:54 AM12/18/13
to mediadrop-...@googlegroups.com
Hi Felix et all,

I've been playing around with redis, and also looking at the mediadrop code. Seems to me there are a bunch of features that we could be using redis for.

The 'latest' query. At the moment it gets all the media that has been published and sorts it. We could implement that in a redis by using a simple queue with a given amount of elements.

Likes. To get the feature so that only one IP address can like an item at a time:
if redis.sadd('likes.IPs.{}'.format(media.id)):
   redis.incr('likes.counter.{}'.format(media.id))

Statistics, a good way to track usage information without hitting the mysql database.

The downside though is that it add a bit more complexity to the stack. Although, that's not very hard to do...

These are just thoughts at the moment.

Adam
Reply all
Reply to author
Forward
0 new messages