Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
廖旭xliao@corp.netease.com   新浪微博 @达达尼奥               2012.5
Thinking in nosql                                廖旭               xliao@corp.netease.com                  新浪微博 @达达尼奥      ...
Thinking in nosql redis彩票项目试用总结及展望                                 廖旭                xliao@corp.netease.com               ...
Redis(REmote DIctionary Server)is an open source, advanced key-value store. It is often referredto as a data structure ser...
Who’s using redis
Why nosql数据量越来越大计算越来越    杂低延迟要求sql也许并不是处理分层数据(hierarchical data)的最好方式,它擅长的是表数据
Redis vs Memcached读写性能上差      不大redis支持更多数据类型,memcached只有kvredis支持持久化(persistence)和数据同步(replication),memcached不支持
Data typesstringslistshashessetssorted sets
Data type - Stringsbinary safemax 512Matomic counters(incr, decr)getbit, setbitsetnx(transaction lock)
Data type - Listsmax 2^32 - 1 elementslpush,rpush(o(1) time complexity)blpop,brpop(blocking queue)ziplist(list-max-ziplist...
Data type - Hashesmax 2^32 - 1 field value pairs适合存储对象(hmset, hmget)zipmap(彩票的package、stakeOrder存储)
Data type - Setsmax 2^32 - 1 membersno repeated members插入、删除、exist操作全部0(1)取交集、并集、diffzipset
Data type - Sorted Sets 和sets类似,只是每一项都有个score值 可以合并,score值加 应用场景:排名榜
Featurespipelinetransactionexpirepub/sublua script(supported in 2.6+)
PipelineRedis is a TCP server using the client-servermodel and what is called a Request/Responseprotocol.频繁创建连接的          ...
Transaction(1)不同于rdbms的事务transaction中的所有指令以顺序的原子的方式执行所有指令要么全部执行要么全不执行
Transaction(2)
Transaction(2)But
Transaction(2)But      无法使用前一指令的结果来操作下一指令      如果一条指令执行失败,后续指令会继续执行      watch, multi, exec      2.6版本的lua script支持也可以实现
Transaction(2)But      无法使用前一指令的结果来操作下一指令      如果一条指令执行失败,后续指令会继续执行      watch, multi, exec      2.6版本的lua script支持也可以实现
AdministrationReplicationPersistenceSecuritySharding(client)
Replicationmaster-slave模式master可有多个slave,slave也可以再有slavemaster和slave端都是non-blocking可实现读写分离(2.6 slave-read-only)、数据备份、灾难
Persistencerdbaof
Securitybind ippasswordssl proxyrename-commandnosql injection(no string escape, it’s safe)
Breaking convention原始号码的存储package, stakeorder的存储优化order, package, stakeorder层级   系的读写弃用transactional发掘最优的api组合
Brainstorming号码池号码统计活动排名...
Tutorialshttp://redis.iohttp://redis.readthedocs.org/en/latest/index.htmlhttp://blog.nosqlfan.com
Thanks    Learn to fail or fail to learncoming next - go语言-互联网时代的C语言
Upcoming SlideShare
Loading in …5
×

Redis slideshare

1,143 views

Published on

Published in: Technology
  • Be the first to comment

Redis slideshare

  1. 1. 廖旭xliao@corp.netease.com 新浪微博 @达达尼奥 2012.5
  2. 2. Thinking in nosql 廖旭 xliao@corp.netease.com 新浪微博 @达达尼奥 2012.5
  3. 3. Thinking in nosql redis彩票项目试用总结及展望 廖旭 xliao@corp.netease.com 新浪微博 @达达尼奥 2012.5
  4. 4. Redis(REmote DIctionary Server)is an open source, advanced key-value store. It is often referredto as a data structure serversince keys can contain strings,hashes, lists, sets and sortedsets.The authors :Salvatore Sanfilippo and PieterNoordhuis (sponsored byVMware).Lastest stable : 2.4
  5. 5. Who’s using redis
  6. 6. Why nosql数据量越来越大计算越来越 杂低延迟要求sql也许并不是处理分层数据(hierarchical data)的最好方式,它擅长的是表数据
  7. 7. Redis vs Memcached读写性能上差 不大redis支持更多数据类型,memcached只有kvredis支持持久化(persistence)和数据同步(replication),memcached不支持
  8. 8. Data typesstringslistshashessetssorted sets
  9. 9. Data type - Stringsbinary safemax 512Matomic counters(incr, decr)getbit, setbitsetnx(transaction lock)
  10. 10. Data type - Listsmax 2^32 - 1 elementslpush,rpush(o(1) time complexity)blpop,brpop(blocking queue)ziplist(list-max-ziplist-entries, list-max-ziplist-value)
  11. 11. Data type - Hashesmax 2^32 - 1 field value pairs适合存储对象(hmset, hmget)zipmap(彩票的package、stakeOrder存储)
  12. 12. Data type - Setsmax 2^32 - 1 membersno repeated members插入、删除、exist操作全部0(1)取交集、并集、diffzipset
  13. 13. Data type - Sorted Sets 和sets类似,只是每一项都有个score值 可以合并,score值加 应用场景:排名榜
  14. 14. Featurespipelinetransactionexpirepub/sublua script(supported in 2.6+)
  15. 15. PipelineRedis is a TCP server using the client-servermodel and what is called a Request/Responseprotocol.频繁创建连接的 销是不可接受的可以一次发送多个命令,不必等待之前命令的reply
  16. 16. Transaction(1)不同于rdbms的事务transaction中的所有指令以顺序的原子的方式执行所有指令要么全部执行要么全不执行
  17. 17. Transaction(2)
  18. 18. Transaction(2)But
  19. 19. Transaction(2)But 无法使用前一指令的结果来操作下一指令 如果一条指令执行失败,后续指令会继续执行 watch, multi, exec 2.6版本的lua script支持也可以实现
  20. 20. Transaction(2)But 无法使用前一指令的结果来操作下一指令 如果一条指令执行失败,后续指令会继续执行 watch, multi, exec 2.6版本的lua script支持也可以实现
  21. 21. AdministrationReplicationPersistenceSecuritySharding(client)
  22. 22. Replicationmaster-slave模式master可有多个slave,slave也可以再有slavemaster和slave端都是non-blocking可实现读写分离(2.6 slave-read-only)、数据备份、灾难
  23. 23. Persistencerdbaof
  24. 24. Securitybind ippasswordssl proxyrename-commandnosql injection(no string escape, it’s safe)
  25. 25. Breaking convention原始号码的存储package, stakeorder的存储优化order, package, stakeorder层级 系的读写弃用transactional发掘最优的api组合
  26. 26. Brainstorming号码池号码统计活动排名...
  27. 27. Tutorialshttp://redis.iohttp://redis.readthedocs.org/en/latest/index.htmlhttp://blog.nosqlfan.com
  28. 28. Thanks Learn to fail or fail to learncoming next - go语言-互联网时代的C语言

×