REDIculouS: Introduction to Redis

1,502 views

Published on

Published in: Technology
  • Be the first to comment

REDIculouS: Introduction to Redis

  1. 1. TITLE REDIculouS
  2. 2. ME Philip Poots @pootsbook Ruby Developer Audacio.us 3 18 3
  3. 3. SUBJECT
  4. 4. INTRO. Redis is… Remote Dictionary Server NoSQL Key-Value Store Data Structures Server ‘Memcached on steroids’
  5. 5. INTRO. Redis is not… SQL Document Store BigTable Store
  6. 6. POSITION The Grand Schema of things Performance Memcached Scalability & Redis MongoDB CouchDB RDBMS Depth of Functionality
  7. 7. BENEFITS Key Value Rediculously Fast In Memory Database Non-blocking IO, single threaded 100,000+ read/writes per second Complements your existing storage
  8. 8. DATA Data Structures String Hash List Set Sorted Set
  9. 9. DATA Data Structures String Hash List Set Sorted Set
  10. 10. SETS Social Connections friends followers following
  11. 11. SETS SQL Create a JOIN table allowing self-reference on users Create indices Verify uniqueness Write lots of code w/ slow queries
  12. 12. SETS Redis For each user have two sets: -  following [1, 3, 5] -  followers [ 2, 3, 4, 7, 9]
  13. 13. SETS Redis: Following SADD
user:1:following
2
 SADD
user:2:followers
1
 
 SADD
user:1:following
3
 SADD
user:3:followers
1
 
 SMEMBERS
user:1:following
 =>
[2,3]
 

  14. 14. SETS Redis: Friend SADD
user:2:following
1
 SADD
user:1:followers
2
 
 SINTER
user:1:following
 

user:1:followers
 =>
[2]

  15. 15. SETS Social Connections RedisSINTER user:1:following user:1:followers user:1:following user:1:followers
  16. 16. MORE Redis redis.io

×