Redis and Redis Cluster

Everything you need to know

@marcgravell

marc@stackoverflow.com

http://marcgravell.blogspot.com

Contents

  • introduction and motivations
  • management
  • coding from .NET
  • scaling out
  • life in the cloud

introduction and motivations

  • high performance key-value store
  • core structures:
    • strings
    • hashes
    • lists
    • sets
    • sorted sets
    • pub/sub

fast

no, really: fast

installation

http://redis.io/download

$ wget http://download.redis.io/releases/redis-2.8.9.tar.gz
$ tar xzf redis-2.8.9.tar.gz
$ cd redis-2.8.9
$ sudo make install
                        

PM> Install-Package Redis-64

C:\> cinst redis-64

management

opserver

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

installation

https://github.com/opserver/Opserver

download, configure, run

coding from .NET

installation

PM> Install-Package StackExchange.Redis

scaling out

Single Master

Master / Slave

Chained Slaves

Sharded

Proxied

Cluster

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
  • chained replication not supported
    • multi-DC not recommended

cluster installation

your.conf

port {n}
cluster-enabled yes
cluster-config-file nodes.conf
cluster-node-timeout 5000
daemonize yes

redis-trib.rb

$ ./redis-trib.rb create --replicas {n} {server0:port0}
{server1:port1} {server2:port2} …

life in the cloud

providers

this list is for information only -
it is neither exhaustive nor a statement of service quality

Questions?

These slides are available:
http://marcgravell.com/

Or, contact me:

@marcgravell

marc@stackoverflow.com

http://marcgravell.blogspot.com