Let's talk about sets

Embed Size (px)

DESCRIPTION

RUBYFUZA 2011 Talk

Text of Let's talk about sets

  • 1. Lets talk about Sets ryan lemmer
  • 2. * email* password * period: start => stop * type: download, upload, visit
  • 3. CREATE
  • 4. CREATE KEY VALUE User:1 {:email => ..., :password => ...}
  • 5. CREATE KEY VALUE UserID 1 User:1 {:email => ..., :password => ...}
  • 6. CREATE KEY VALUE UserID 1 User:1 {:email => ..., :password => ...} UsageID 1 Usage:1 {:start => ?, :stop => ?, :type => download, :user_id => 1}
  • 7. GET ITEM
  • 8. GET ITEM KEY VALUE UserID 1 User:1 {:email => ..., :password => ...} UsageID 1 Usage:1 {:start => ?, :stop => ?, :type => download, :user_id => 1}
  • 9. GET ITEM
  • 10. GET ITEM KEY VALUE UserID 2 User:1 {:email => ..., :password => ...} User:2 {:email => ..., :password => ...} User: zaphod@m.com 1 User: vortex@m.com 2
  • 11. GET ITEMS Usage:2 UserID User:5 User:2 User:1 User:4 Usage:3 User:3 Usage:7 Usage:5 Usage:1 Usage:4 Usage:6 Usage:8
  • 12. GET ITEMS KEY VALUE UserID 2 User:1 {:email => ..., :password => ...} User:2 {:email => ..., :password => ...} User:3 {:email => ..., :password => ...} Users
  • 13. GET ITEMS KEY VALUE UserID 2 User:1 {:email => ..., :password => ...} User:2 {:email => ..., :password => ...} User:3 {:email => ..., :password => ...} Users
  • 14. SORTED ITEMS
  • 15. SORTED ITEMSUser:1:usages 3 2 4 1 5 value 1262325600 1262348100 1262369700 1262416500 1262512860 score
  • 16. SORTED ITEMSUser:1:usages 3 2 4 1 5 value 1262325600 1262348100 1262369700 1262416500 1262512860 score 0 1 2 3 4 index
  • 17. SORTED ITEMSUser:1:usages 3 2 4 1 5 value 1262325600 1262348100 1262369700 1262416500 1262512860 score
  • 18. SORTED ITEMS KEY VALUE UserID 2 User:1 {:email => ..., :password => ...} User:2 {:email => ..., :password => ...} User:3 {:email => ..., :password => ...} Users User:1:usages User:2:usages
  • 19. FILTERITEMS
  • 20. FILTERITEMS Downloads 1 5 7 8 Uploads 2 4 6 Visits 3
  • 21. FILTERITEMS Downloads 1 5 7 8 Uploads 2 4 6 Visits 3
  • 22. FILTERITEMS Downloads User:1:usages 1 5 7 8 1 3 4 5 Uploads 2 2 4 6 Visits 3
  • 23. FILTERITEMS INTERSECTION 3 User:1:usages 1 7 Usage:downloads 4 5 8 2
  • 24. FILTERITEMS Usage:downloads 1 5 7 8 Usage:uploads 2 4 6
  • 25. FILTERITEMS User:1:usages Usage:downloads 1 3 1 5 4 5 7 8 2 Usage:uploads 2 4 6
  • 26. Checkout...github.com/ezmobius/redis-rbohm.keyvalue.org ryan lemmer