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

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×

Introducing the official SlideShare app

Stunning, full-screen experience for iPhone and Android

Text the download link to your phone

Standard text messaging rates apply

Redis

2,937
views

Published on

A brief introduction to Redis I gave at Seattle Tech Startups meetup on November 11, 2010. Provides some example use cases.

A brief introduction to Redis I gave at Seattle Tech Startups meetup on November 11, 2010. Provides some example use cases.

Published in: Technology, Health & Medicine

0 Comments
4 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
2,937
On Slideshare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
37
Comments
0
Likes
4
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

Transcript

  • 1. Redis Damon Cortesi (@dacort) Untitled Startup (RowFeeder)
  • 2. Movember • Help support prostate cancer research • http://bit.ly/mo_dacort
  • 3. Up and Running • wget http://redis.googlecode.com/files/ redis-2.0.4.tar.gz • tar xzvf redis-2.0.4.tar.gz • cd redis-2.0.4 • make • ./redis-server
  • 4. Yes...that’s it • Redis in your browser • http://try.redis-db.com • http://code.google.com/p/redis/wiki/ CommandReference
  • 5. http://try.redis-db.com
  • 6. 101 • Key/Value Store on Steroids • memcache? • Persistent • Push/Pop • Data types • Fast - 110000 SETs/sec, 81000 GETs/sec
  • 7. Redis Data Types • Strings • Lists • Sets • Sorted/Scored Sets • Hashes
  • 8. But wait, there’s more! • Clustering • Replication • Master/Slave • Publish/Subscribe
  • 9. Use Cases • Queue Processing • Set Intersection • Stats Tracking/Leaderboards
  • 10. Keyword Filter Geo Filter Other Custom Filters Resque Queue (redis) Resque Workers MongoDB Status Storage External Data Tagging - bit.ly, geo, klout rowfeeder.com MySQL User & Track Data Slave MySQL Geo Lookups Memcache Web Status Processing Google Spreadsheet
  • 11. Queues • Resque - Killer Ruby library for background jobs • RowFeeder - 428,811,359 items processed a b c d LPOP RPUSH
  • 12. Set Intersections • Goal: Contact Ashton Kutcher on Twitter • Approach: Is there anybody I can DM that can DM Ashton, or a friend of his?
  • 13. Step 1 • Are any of my followers his friends? • SADD - Add specified member to the set • SINTER - Intersection of N sets
  • 14. Step 2 • Can I DM somebody that can DM a friend of his? • ?t ?
  • 15. Sweet!
  • 16. Scoreboards • Sorted ZSets • ZINCRBY - Increment Operator • ZRANGE - Sort + Subset
  • 17. • Tracks Twitter/Facebook Posts • ~4,000 keywords monitored in real-time • ~2MM posts/day • Sometimes...
  • 18. What’s Blowing Up?
  • 19. Step 1 • Maintain counters of all matched terms • Increment the “stream::kw::time” key by 1
  • 20. Step 2 • 5 minute running average of the top 10 terms
  • 21. Limitations • Greedy with memory • If it grows to XGB...it will stay there • (Not optimal if a queue backs up) • All in RAM / Atomicity • 2.0 solves both of these! • NoSQL
  • 22. Questions • @dacort • damon [at] untitledstartup.com