Getting up to speed with Redis

(NDC London, 2014)



  • introduction and motivations
  • the server
  • the client
  • feature examples
  • redis cluster
  • summary

introduction and motivations

  • key-value store
  • nosql database
  • high performance
  • scaleable
  • in-memory
  • single-threaded

core data structures

  • strings
  • hashes
  • lists
  • sets
  • sorted sets
  • …simple data; powerful operations

additional features

  • pub/sub channel-based distribution
  • transactions
  • scripting
  • replication
  • fast
  • no, really fast

the server

$ wget
$ tar xzf redis-2.8.18.tar.gz
$ cd redis-2.8.18
$ sudo make install

PM> Install-Package Redis-64

C:\> cinst redis-64

apt-get install redis

or host in the cloud

  • Microsoft: Azure Redis Cache
  • Redis Labs: Redis Cloud
  • Amazon: ElastiCache
  • and others


  • multi-purpose monitoring tool
  • inbuilt support for SQL
  • inbuilt support for Redis

the client

clients (often more than one) for most frameworks…

…and simple (ish) protocol to write for new platforms

PM> Install-Package StackExchange.Redis PM> Install-Package StackExchange.Redis.StrongName

feature examples

show me teh codez!

  • basic usage
  • performance
  • hyperloglog
  • scripting and transactions
  • pub/sub

redis cluster

Single Master

Master / Slave

Chained Slaves




cluster features

  • distributed keyspace
  • live resharding
    • redirection (not proxying)
  • HA fault tolerance
  • node discovery
  • "hash tags" allow same-node control: "{/users/12345}/balance" vs "{/users/12345}/credits"

cluster restrictions

  • requires cluster-aware client
  • multiple databases not supported
  • all multi-key commands must be on same node
  • some commands must now be considered per-server
    • keys, scan, flushdb, flushall


  • described what redis is
  • described the key features
  • installed the server
  • installed the client
  • ran some code
  • looked to the future


These slides are available:

Or, contact me: