Redis by Svilen Ivanov

download Redis by Svilen Ivanov

If you can't read please download the document

description

Redis talk by Svilen Ivanov at VarnaConf 2013

Transcript of Redis by Svilen Ivanov

  • 1. Redis? VarnaConf 20 2013

2. 2 / 178 , , ... ... Java, Perl, JavaScript, Ruby... Java JavaScript [email protected] @buhtum 3. Redis? key/value * , string, : List () Hash ( ) Set ( e) Sorted Set ( ) 3 / 178 4. 4 / 178 5. (1) SET/GET MSET/MGET INCR/INCRBY, DECR/DECRBY : GETSET , : SETNX , : SETBIT, BITCOUNT : 6. e: : SETNX lock.foo : GET lock.foo + GETSET lock.foo + DEL 7. : , / , user:123, logins:2013-03-31, user:123:followers, etc. ( ) : JSON, Protocol Buffers... 8. : list () 9. : list () 10. (job queue) RPUSH, LPOP BRPUSH, BLPOP: timeline LPUSH LRANGE N Recently viewed LPUSH LTRIM n 11. : set () 12. : set () SINTER SINTERSTORE SUNION SUNIONSTORE SDIFF SDIFFSTORE 13. ( followers, followees) SADD, SREM ID Tagging tag: tag:linux, tag:programming, tag:ruby ID SINTER tag:linux, tag:programming 14. : (sorted sets) Set, , : Stefan1 Peter3 Svilen4 ZADD leaderboard 2 Ivan ZRANGE leaderboard 0 -1 1) "Stefan" 2) "Ivan" 3) "Peter" 4) "Svilen" Ivan2 Stefan1 Peter3 Svilen4 15. : (sorted sets) ZRANK, ZREVRANK ZREMRANGEBY* - RANK SCORE ZINCRBY 16. : (hash) 17. 18. (1) (snapshoting) , append-only master-slave (scalability) master 19. (2) ? sharding failover : sentinel upgrade downtime 20. 21. ?