8. Support lots of complex
operations, you don’t need to
process data in client side.
a lot of I/O is sometimes needed
9. Data types
• Strings
– Binary safe, with a maximum of 512MB
• Lists
• Sets
• Sorted sets
– Set with score
• Hashes
– Perfect to represent object
10. Publish–subscribe
• Redis supports publish-subscribe
mode.
• You can subscribe some topics, and
when someone publish topic matches
your interest, redis send it to you.
11. Transactions
• Redis also support transactions.
• you can execute multiple command in a
single step.
• Either all of the commands or none are
processed
> MULTI
OK
> INCR foo
QUEUED
> INCR bar
QUEUED
> EXEC
1) (integer) 1
2) (integer) 1
13. Persistence
• You can choose persistence yourself
– RDB
• Take snapshot in an interval
• Fast
• may loss several minutes data if kill -9
– AOF
• Log-based, redo whole steps since startup
• Still fast enough
• may loss 1 second data if kill -9
– None(like memcached)
14. Partition
• There are three way that is recommend by
redis official group.
– Redis Cluster
• Official way, Under development
– Twemproxy
• Twitter developed, support redis and memcached.
– Clients supporting consistent hashing
15. Twemproxy
• Twemproxy is an intermediate layer
between clients and Redis instances.
• Reliably handle partitioning
Redis
instance
Twem
Client
proxy
Redis
instance
Redis
Twem instance
Client
proxy
Redis
instance