redis
DESCRIPTION
Redis - a Fast key-value memory based databaseTRANSCRIPT
Ensky Lin
Redis is a Fast, Memory-based key-value storage database.
And more…
Features
• Data types
• Publish–subscribe
• Transactions
• Replication
• Persistence
• Partition
Licence
Fast
• Almost the same as Memcached
Fast
• Even more, the bottleneck may from your network card.
Support lots of complex operations, you don’t need to
process data in client side.
a lot of I/O is sometimes needed
Data types
• Strings
– Binary safe, with a maximum of 512MB
• Lists
• Sets
• Sorted sets
– Set with score
• Hashes
– Perfect to represent object
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.
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
Replication
• Official Master-slave replication
– Write in Master, Read in Slaves
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)
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
Twemproxy
• Twemproxy is an intermediate layer between clients and Redis instances.
• Reliably handle partitioning
Client
Twemproxy
Redis instance
Redis instance
Redis instance
Redis instance
Client Twemproxy
Many clients for nearly all languages
• ActionScript • C / C++ • C# • Clojure • Lisp • Dart • Erlang • Fancy • Go • Haskell • haXe • Io • Java
• Lua • Node.js • Objective-C • Perl • PHP • Python • Ruby • Scala • Smalltalk • Tcl
Who is using redis?
Redis project is sponsored by
And use by …
Thank you!