RedPipe: Pain-Free Pipelining

Did you try to use Redis pipelines? Did you give up after an hour of trying? Did you get a pounding headache? Did you throw your laptop in frustration?

Never fear. RedPipe will make you feel better almost immediately.

If you have no idea what Redis is or why you should pipeline commands, look it up already.

BuildStatus CoverageStatus Version Python

This project is beta software. The interface may change.

The code is well tested and rapidly stabilizing. Check back soon.

Requirements

The redpipe module requires Python 2.7 or higher.

It also requires redis-py or redis-py-cluster.

What is RedPipe?

RedPipe is a python package that makes it easy to reduce network round trips when talking to redis. It is a wrapper around the pipeline component of redis-py or redis-py-cluster.

For more general information about redis pipelining, see the official redis documentation.

Use redpipe to build pipelined redis calls in a modular reusable way. Rewrite your existing application calls via redis-py into efficient batches with only minimal changes.

How Does it Work?

RedPipe gives you the ability to pipeline commands in a more natural way than the interface provided via redis-py.

Some concepts sound complicated:

This documentation will explain all of these concepts and why they are important.

All of these things together allow you to build modular functions that can be combined with other pipelined functions.

You will be able to pass a pipeline into multiple functions, collect the results from each function, and then execute the pipeline to hydrate those result objects with data.

What do I Need to Know?

If you’ve used redis-py, you know most of what you need already to start using RedPipe.

If not, head over there and play with redis-py first. Or check out this very easy tutorial on redis-py basics:

http://agiliq.com/blog/2015/03/getting-started-with-redis-py/

You’ll find the redpipe api looks nearly identical. That’s because RedPipe is a wrapper around redis-py.

RedPipe adds the ability to pipeline commands in a more natural way.

What Else Can it do?

You can use just the core of the redpipe module. That’s the wrapper part.

But there’s a lot of other cool things included. Be sure to check out the keyspaced data-types. And the Struct objects are cool too.

More on this later.


API Documentation

This part of the documentation provides detailed API documentation. Dig into the source code and see how everything ties together. This is what is great about open-source projects. You can see everything.