jazzband / django-redis

Full featured redis cache backend for Django.
Other
2.87k stars 432 forks source link

Redis Pipelining #129

Closed uditagarwal closed 9 years ago

uditagarwal commented 9 years ago

Does django-redis currently support Pipelining? If I wanted to implement something like this

http://www.pnegahdar.com/django-redis-pipeline-trick/

How would I go about it using django-redis

niwinz commented 9 years ago

django-redis allows us access to the native redis-py connection so you can do something like this. But no directly with django cache interface. http://niwibe.github.io/django-redis/latest/#_raw_client_access

uditagarwal commented 9 years ago

I would need to replace the default django cache functionality in this case. Are there any benchmarks which suggest that RawRedis would be faster than Djangos' caching?

niwinz commented 9 years ago

I'm not clearly understand your question, django cachings system is a interface with plugable backends. django-redis has an implementation for django cachings system using the redis-py.

But additionally offers a lot of other things, access to the redis-py connection is one of much others.

I do not how can django caching interface faster than raw connection because django caching system uses raw (redis-py) connectons on its implementation.

faizanfareed commented 4 years ago

This way we can use pipeline in django-redis

  con = get_redis_connection("default",)     
  for postkey in feedlist: # feedlist is consist of hash keys
       pipeline.execute_command('hgetall',postkey)
   result = pipeline.execute()