7. Redis
Redis is an open source, advanced key-
value store. It is often referred to as a data
structure server since keys can contain
strings, hashes, lists, sets and sorted sets.
http://redis.io
24. Translating queries
atomic operations
$set - set a particular value
$unset - set a particular value
$inc - increment a particular value by a certain amount
$push - append a value to an array
$pushAll - append several values to an array
$pull - remove a value(s) from an existing array
$pullAll - remove several value(s) from an existing array
$bit - bitwis
30. Mongo to the rescue ?
Sometimes you just know MongoDB
better than Redis
Most of query features of Redis can
be translated in Mongo queries
But for Redis addicts, MongoDB has
some secrets
32. Used to MongoDB ?[lol@cats ~]# bin/mongo
MongoDB shell version: 1.6.4
connecting to: test
> show dbs
admin
local
monque
> use monque
switched to db monque
> db.getCollectionNames();
[
"delayed_queue",
"failures",
"job_groups",
"monque",
"queues",
"schedules",
"schedules_changed",
"stats",
"system.indexes",
"workers"
]
> db.workers.count();
40
> db.workers.findOne();
{
"_id" : ObjectId("4c863c6c89cb535954000001"),
"started" : "Tue Sep 07 2010 13:21:48 GMT+0000 (UTC)",
"worker" : "myserver:22868:facebook*"
}
33. Used to MongoDB ?
require 'rubygems'
require 'mongo'
include Mongo
db = Connection.new.db('sample-db')
coll = db.collection('test')
coll.remove
3.times do |i|
coll.insert({'a' => i+1})
end
puts "There are #{coll.count()} records. Here they are:"
coll.find().each { |doc| puts doc.inspect }
56. Help needed !
Add exclusive features to resque-web
Migrate existing plugins
Create new plugins
Promote the gem
Or simply use the gem, you ‘ll surely
send pull requests
57. That’s all folks
Credits for Flickr images: acezebragirl4j,
kiwitime, fulbert05, josh_exell, benheine,
tudacee