Upload
others
View
16
Download
0
Embed Size (px)
Citation preview
Mathias Meyer, 22.10.2009Peritor GmbH
Redis - Fast and FuriousN✮SQL Berlin
Donnerstag, 22. Oktober 2009
Self
I work at Peritor in Berlin
I tweet @roidrage
I code at http://github.com/mattmatt
I blog at http://paperplanes.de
2
Donnerstag, 22. Oktober 2009
Redis - Key-Value Store
Simple, yet awesome
Fast, yet nonvolatile
code.google.com/p/redis
4
Donnerstag, 22. Oktober 2009
Redis
Simple and efficient text-based protocol
(just like grandma and Memcached used to make)
11
Donnerstag, 22. Oktober 2009
Redis Protocol - Special Ops
Push and pop elements (atomic)
Fetch arbitrary set and array elements
Sorting
16
Donnerstag, 22. Oktober 2009
Redis Protocol
get foo
$4
1000
get bar
$-1
18
Request
Response
RequestResponse
Donnerstag, 22. Oktober 2009
Redis Protocol - Lists
lpush pizza 4
fury
+OK
rpush pizza 8
ortolana
+OK
20
Donnerstag, 22. Oktober 2009
Redis Protocol - Lists
lrange pizza 0 1
*2
$4
fury
$8
ortolana
21
Request
Response
Donnerstag, 22. Oktober 2009
Redis Protocol - The Rest
Random list/set access
Intersections, Unions
Monitoring
Controlling the Server
Multi-Set Commands
25
Donnerstag, 22. Oktober 2009
Redis Key-Value Database
Persistent
Asynchronous
Just like Super Pursuit Mode
27
Donnerstag, 22. Oktober 2009
Redis Database
29
Redis Server
Redis Serverfork()
Dump Database
exit()
rename()
Donnerstag, 22. Oktober 2009
Replication
1 Master - N Slaves
Asynchronous on Master
Synchronous on Slave
31
Donnerstag, 22. Oktober 2009
Redis ReplicationLike dumping the database, only to a different file descriptor.
32
Donnerstag, 22. Oktober 2009
Redis Master
Redis Slave Redis Slave
Redis SlaveRedis Slave
Redis Replication
33
Donnerstag, 22. Oktober 2009
Redis - Scaling
Horizontal• Run multiple Redis processes
• Use HashRing (e.g. in redis-rb)
34
Donnerstag, 22. Oktober 2009
Redis - Scaling
Vertical• Master-Slave setup
• Fetch data from any slave (e.g. random)
35
Donnerstag, 22. Oktober 2009
Not to Redis
100% consistent dataset requiredData is larger than memory
39
Donnerstag, 22. Oktober 2009
© Peritor GmbH - Alle Rechte Vorbehalten
Peritor GmbHBlücherstr. 22, Hof III Aufgang 610961 Berlin
Tel.: +49 (0)30 69 20 09 84 0Fax: +49 (0)30 69 20 09 84 9
Internet: www.peritor.comE-Mail: [email protected]
Donnerstag, 22. Oktober 2009