RedisGears
¶
What is RedisGears? ¶
RedisGears is an engine for data processing in Redis. RedisGears supports transaction, batch , and event-driven processing of Redis data. To use RedisGears, you write functions that describe how your data should be processed. You then submit this code to your Redis deployment for remote execution.
As of v1.0.0, code for RedisGears must be written in Python. However, an internal C API exists and can be used by other Redis modules. In addition, support for other languages is being planned.
To take a simple example, you can use RedisGears to count the words in Redis:
gb = GearsBuilder()
gb.map(lambda x: x['value']) # map records to "sentence" values
gb.flatmap(lambda x: x.split()) # split sentences to words
gb.countby() # count each word's occurrences
gb.run()
In broad strokes, the following diagram depicts RedisGears' components:
+---------------------------------------------------------------------+
| Redis Server +--------------------------------------+ |
| | RedisGears Module | |
| +----------------+ | | |
| | Data | Input | +------------+ +-------------------+ | |
| | +-------->+ | Function | | APIs | | |
| | Key1 : Value1 | | | +--------+ | | C, Python, ... | | |
| | Key2 : Value2 | Output | | | Reader | | +-------------------+ | |
| | Key3 : Value3 <---------+ | +---+----+ | +-------------------+ | |
| | ... | | | v | | Redis commands | | |
| +----------------+ | | +---+----+ | | Gears admin & ops | | |
| | | | Step 1 | | +-------------------+ | |
| | | +---+----+ | +-------------------+ | |
| +----------------+ | | v | | Coordinator | | |
| | Events | | | +---+----+ | | Cluster MapReduce | | |
| | | Trigger | | | Step 2 | | +-------------------+ | |
| | Data update +-------->+ | +---+----+ | +-------------------+ | |
| | Stream message | | | v | | Engine | | |
| | Time interval | | | ... | | Runtime execution | | |
| | ... | | +------------+ +-------------------+ | |
| +----------------+ +--------------------------------------+ |
+---------------------------------------------------------------------+
Where Next? ¶
- The Introduction is the recommended starting point
- The Overview page summarizes important RedisGears concepts
- The reference pages describe RedisGears' Runtime , Functions , Readers , Operations and integration with RedisAI
- The RedisGears Commands reference describes all commands
- The Quickstart page provides information about getting, building, installing, and running RedisGears
- There are interesting RedisGears uses cases and recipes on the Examples page
Quick Links ¶
Contact Us ¶
If you have questions or feedback, or want to report an issue or contribute some code , here's where you can get in touch:
License ¶
RedisGears is licensed under the Redis Source Available License Agreement .