Redis logo

An advanced key value store

Talk by Tim Gibbon / @TommyBobbins


  • Fast and lightweight - Raspberry Pi will handle 2000 requests per second.
  • Simple - easy set/get calls.
  • Can store all programatical data types ( arrays, hashes, strings, lists, sorted lists).
  • Large range of useful extras.
  • Can be easily clustered.
  • Persistence - data is written to disk.


  • Security. Cannot be safely run across t'internet.
  • Number of available commands and configuration can be offputting.
  • Code is built by Pivotal, but is BSD licenced.
Freaky Clown

Using Redis?

  • Twitter
  • Github
  • Weibo
  • Pinterest
  • Snapchat
  • Craigslist
  • Digg
  • StackOverflow
  • Flickr
  • Me
Soho. ed_needs_a_bicycle


                                               pi@raspberrypi: ~/$ sudo apt-get install redis-server python-redis
Old Tools and Spanners by Ian Britton

Command line usage

pi@raspberrypi ~/$ redis-cli -h localhost set temperature/sensor/cellar 20.0
pi@raspberrypi ~/$ redis-cli -h localhost get temperature/sensor/cellar
pi@raspberrypi ~/$ redis-cli -h localhost expire temperature/sensor/cellar 5
(integer) 1
pi@raspberrypi ~/$ redis-cli -h localhost get temperature/sensor/cellar
pi@raspberrypi ~/$ redis-cli -h localhost get temperature/sensor/cellar

Python and Redis

import redis
redthis = redis.StrictRedis(host='433board',port=6379, db=0, socket_timeout=3)

    #Read in all the previous settings
    redthis.set("temperature/calendar", calendar_temp)


          pi@raspberrypi ~/$ redis-benchmark -q -n 1000
          PING_INLINE: 2659.57 requests per second
          PING_BULK: 2403.85 requests per second
          SET: 2242.15 requests per second 
          GET: 2352.94 requests per second
          INCR: 2242.15 requests per second
          LPUSH: 1855.29 requests per second
          LPOP: 2314.81 requests per second
          SADD: 2272.73 requests per second
          SPOP: 2577.32 requests per second
          LPUSH (needed to benchmark LRANGE): 2127.66 requests per second
          LRANGE_100 (first 100 elements): 964.32 requests per second
          LRANGE_300 (first 300 elements): 417.01 requests per second
          LRANGE_500 (first 450 elements): 250.13 requests per second
          LRANGE_600 (first 600 elements): 220.56 requests per second
          MSET (10 keys): 1488.10 requests per second

Application - Raspberry Pi powered home automation


Tim Gibbon /

Photo Credits

  • Soho © ed_needs_a_bicycle CC BY-NC-SA 2.0
  • Old Tools and Spanners © Ian Britton CC BY-NC 2.0