PlayNice.ly: Using Redis to store all our data, hahaha (Redis London Meetup)
1. #redisldn
Welcome
(The First) London Redis Meetup
@robbiehudson
@adamcharnock
@bash
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
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. #redisldn
Created by...
Salvatore Sanfilippo (@antirez)
... now VMWare
... and Pieter Noordhuis
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. #redisldn
Redis schema example
• Why you need a schema? ho ho ho
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. #redisldn
A quick example
>>> user = models.User.create()
>>> user.user_id
6
>>> user.name = "Pete"
>>> user.name
u'Pete'
>>> user.projects
[]
15. #redisldn
A quick example
>>> project = models.Project.create()
>>> project.project_id
8
>>> project.users
[]
16. #redisldn
A quick example
>>> project.users.add(6)
>>> project.users
[6]
>>> user.projects
[8]
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. #redisldn
Find out more!
•http://playnice.ly
• http://playnice.ly/blog
• @playnicelyapp
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)
Admin stuff
Thanks to Mint for hosting
Why we’re organising it
Hashtag
Video/Slides etc
Put some times on here and include QA and drinks!!
Russian for Radish?
non-blocking io, single threaded
pub sub and notifications
replication
cluster support soon
1.2.6
2.0 RC1 out...
Lives in Italy
Active Mailing List
20 client libraries in over 10 different languages
“Just about to enter private beta”
Chose redis because
1. Its cool
2. Damn fast and scales well
- we went into it thinking: “hey, no schema needed :)”
- sadly, not the case, need some structure (e.g. to key naming)
- so here is how we tackled it...
- pretty obvious, just string keys :)
- again, pretty clear what is going on
- linking projects and users? ...
Sets store COLLECTION of unique values, and will optimise data storage for integer values
Data integrity is enforced at the API level, not the DB level
Migrations