Your SlideShare is downloading. ×
Redis slideshare
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Redis slideshare

810
views

Published on

Published in: Technology

0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
810
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
0
Comments
0
Likes
1
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • Transcript

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

    ×