Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Redis with Ruby
Search
Damian Le Nouaille
April 04, 2012
Programming
4
260
Redis with Ruby
Damian Le Nouaille
April 04, 2012
Tweet
Share
More Decks by Damian Le Nouaille
See All by Damian Le Nouaille
Re-Think your workflow with a piano
damln
0
150
Optimize or Die Tryin'
damln
1
220
Rails YAML vuln.
damln
1
220
Rails et Heroku
damln
3
340
Capucine
damln
1
140
Other Decks in Programming
See All in Programming
360° Signals in Angular: Signal Forms with SignalStore & Resources @ngLondon 01/2026
manfredsteyer
PRO
0
110
Apache Iceberg V3 and migration to V3
tomtanaka
0
150
AIと一緒にレガシーに向き合ってみた
nyafunta9858
0
170
なるべく楽してバックエンドに型をつけたい!(楽とは言ってない)
hibiki_cube
0
140
Basic Architectures
denyspoltorak
0
660
AI Agent の開発と運用を支える Durable Execution #AgentsInProd
izumin5210
7
2.3k
カスタマーサクセス業務を変革したヘルススコアの実現と学び
_hummer0724
0
620
プロダクトオーナーから見たSOC2 _SOC2ゆるミートアップ#2
kekekenta
0
200
Vibe Coding - AI 驅動的軟體開發
mickyp100
0
170
CSC307 Lecture 03
javiergs
PRO
1
490
Implementation Patterns
denyspoltorak
0
280
LLM Observabilityによる 対話型音声AIアプリケーションの安定運用
gekko0114
2
420
Featured
See All Featured
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
508
140k
Reflections from 52 weeks, 52 projects
jeffersonlam
356
21k
Introduction to Domain-Driven Design and Collaborative software design
baasie
1
580
Principles of Awesome APIs and How to Build Them.
keavy
128
17k
Building an army of robots
kneath
306
46k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
162
16k
Data-driven link building: lessons from a $708K investment (BrightonSEO talk)
szymonslowik
1
910
Being A Developer After 40
akosma
91
590k
Git: the NoSQL Database
bkeepers
PRO
432
66k
The Anti-SEO Checklist Checklist. Pubcon Cyber Week
ryanjones
0
55
AI Search: Where Are We & What Can We Do About It?
aleyda
0
6.9k
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
Transcript
None
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. gem ‘redis’
USE Cache Session (cookies) gem ‘redis-rails’ App::Application.config.session_store :redis_store, :servers =>
"redis://127.0.0.1:6379/1"
Commands $redis = new Redis(:host => ‘127.0.0.7’, :port => 6379,
:db => 0) $redis.set(‘my_key’, ‘awesome’) $redis.get(‘my_key’) => ‘awesome’ $redis.del(‘my_key’)
ENVIRONMENT Resque (+ Scheduler) Ohm EventMachine PubSub
Resque (+Scheduler) Fast ² Queue YAML - Cron gem ‘resque’
gem ‘resque-scheduler’, git: 'git://github.com/bvandenbos/resque-scheduler'
Ohm ORM Flexible Extensible gem ‘ohm’ gem ‘ohm-contrib’
Ohm (model) class User < Ohm::Model attribute :name attribute :nickname
include Ohm::Validations extend ActiveModel::Naming include ActiveModel::AttributeMethods index :name collection :messages, Message end
Ohm (model) class User < Ohm::Model def persisted? false end
def to_hash super.merge({:name => self.name}) end end
Ohm (model) class Message < Ohm::Model attribute :content include Ohm::Validations
extend ActiveModel::Naming include ActiveModel::AttributeMethods index :content reference :user, User end
EventMachine Node.js for Ruby em-WebSocket em-redis gem ‘eventmachine’ gem ‘em-redis’
PubSub $redis = new Redis(:host => ‘127.0.0.7’, :port => 6379,
:db => 0) $redis.publish(‘my_channel’, ‘content’) $redis.subscribe(‘my_channel’) do |on| on.message do |channel, msg| puts msg end end $redis.publish(‘my_channel.*’, ‘content’)
PRODUCTION Debian / OSX Heroku Easy (foreman)
@ damln www.dln.name