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.
#redisldn




    Welcome
(The First) London Redis Meetup

       @robbiehudson
       @adamcharnock
          @bash
#redisldn

                               The Agenda
• Quick Redis introduction
• Using Redis to store all our data, hahah...
#redisldn




Onwards!
#redisldn

What is Redis?
#redisldn

                What is Redis?

• Advanced key value store
• Data Structure Server (+ more!)
 • Lists, Sets, Ha...
#redisldn

  Created by...




Salvatore Sanfilippo (@antirez)
          ... now VMWare
    ... and Pieter Noordhuis
#redisldn

               Redis and PlayNice.ly

•   PlayNice.ly: Collaboration web app for software developers...
 •   So...
#redisldn

       Redis schema example


• Why you need a schema? ho ho ho
#redisldn

                     Users

user:5:name → “Pete Mascot”
user:5:username → “pete”
user:5:email → “pete@playnice....
#redisldn

                   Projects

project:9:name → “Alan Parson’s Project”
project:9:created_at → 1274815155
...
#redisldn

   Linking users to projects

user:5:projects → SET(2, 9, 13)

project:9:users → SET(3, 5, 9)
#redisldn

 But that looks like hard work!


• Yes it is, so use a model!
#redisldn

                ORM for Redis

• Ohm: http://ohm.keyvalue.org (Ruby)
• http://github.com/nateware/redis-objects...
#redisldn

    A quick example
>>> user = models.User.create()
>>> user.user_id
6
>>> user.name = "Pete"
>>> user.name
u'P...
#redisldn

    A quick example

>>> project = models.Project.create()
>>> project.project_id
8
>>> project.users
[]
#redisldn

    A quick example

>>> project.users.add(6)
>>> project.users
[6]
>>> user.projects
[8]
#redisldn

Proving it actually worked...
>>> redis.get("user:6:name")
'Pete'

>>> redis.smembers("project:8:users")
set(['...
#redisldn

                      Summary
• It is very fast!
• Other cool stuff:
 • search
 • migrations
 • message queuing...
#redisldn

             Find out more!

•http://playnice.ly
• http://playnice.ly/blog
• @playnicelyapp
#redisldn

                               The Agenda

• Quick Redis introduction
• Using Redis to store all our data, haha...
#redisldn




   Thanks!
Any Questions?
Upcoming SlideShare
Loading in …5
×

PlayNice.ly: Using Redis to store all our data, hahaha (Redis London Meetup)

9,297 views

Published on

PlayNice.ly's presentation at the first London Redis Meetup. A quick into to Redis, then digging down into some schema design examples.

Published in: Technology
  • Be the first to comment

PlayNice.ly: Using Redis to store all our data, hahaha (Redis London Meetup)

  1. 1. #redisldn Welcome (The First) London Redis Meetup @robbiehudson @adamcharnock @bash
  2. 2. #redisldn The Agenda • Quick Redis introduction • Using Redis to store all our data, hahaha (Rob & Adam / PlayNice.ly) • Queuing and non-persistent lists (Thomas / Mint Digital) • Super-fast caching and Redis (Demis / mFlow) • QA
  3. 3. #redisldn Onwards!
  4. 4. #redisldn What is Redis?
  5. 5. #redisldn What is Redis? • Advanced key value store • Data Structure Server (+ more!) • Lists, Sets, Hashes (and lots of other cool stuff) • Super-fast in Memory • But it is persistent, and now supports VM
  6. 6. #redisldn Created by... Salvatore Sanfilippo (@antirez) ... now VMWare ... and Pieter Noordhuis
  7. 7. #redisldn Redis and PlayNice.ly • PlayNice.ly: Collaboration web app for software developers... • So, a bug tracker :) • And we store all our information in Redis • users, projects, bugs, comments, audit logging, search indexes...
  8. 8. #redisldn Redis schema example • Why you need a schema? ho ho ho
  9. 9. #redisldn Users user:5:name → “Pete Mascot” user:5:username → “pete” user:5:email → “pete@playnice.ly”
  10. 10. #redisldn Projects project:9:name → “Alan Parson’s Project” project:9:created_at → 1274815155 ...
  11. 11. #redisldn Linking users to projects user:5:projects → SET(2, 9, 13) project:9:users → SET(3, 5, 9)
  12. 12. #redisldn But that looks like hard work! • Yes it is, so use a model!
  13. 13. #redisldn ORM for Redis • Ohm: http://ohm.keyvalue.org (Ruby) • http://github.com/nateware/redis-objects (Ruby) • http://github.com/whoahbot/dm-redis-adapter (Ruby) • http://github.com/kijin/stalkr (PHP, “not production ready”) • Roll your own (like we did, for Python)
  14. 14. #redisldn A quick example >>> user = models.User.create() >>> user.user_id 6 >>> user.name = "Pete" >>> user.name u'Pete' >>> user.projects []
  15. 15. #redisldn A quick example >>> project = models.Project.create() >>> project.project_id 8 >>> project.users []
  16. 16. #redisldn A quick example >>> project.users.add(6) >>> project.users [6] >>> user.projects [8]
  17. 17. #redisldn Proving it actually worked... >>> redis.get("user:6:name") 'Pete' >>> redis.smembers("project:8:users") set(['6']) >>> redis.smembers("user:6:projects") set(['8'])
  18. 18. #redisldn Summary • It is very fast! • Other cool stuff: • search • migrations • message queuing • PlayNice.ly is entering into Private Beta in the next few weeks!
  19. 19. #redisldn Find out more! •http://playnice.ly • http://playnice.ly/blog • @playnicelyapp
  20. 20. #redisldn The Agenda • Quick Redis introduction • Using Redis to store all our data, hahaha (Rob & Adam / PlayNice.ly) • Queuing and non-persistent lists (Thomas / Mint Digital) • Super-fast caching and Redis (Demis / mFlow)
  21. 21. #redisldn Thanks! Any Questions?

×