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
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Damian Le Nouaille
April 04, 2012
Programming
260
4
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Redis with Ruby
Damian Le Nouaille
April 04, 2012
More Decks by Damian Le Nouaille
See All by Damian Le Nouaille
Re-Think your workflow with a piano
damln
0
170
Optimize or Die Tryin'
damln
1
230
Rails YAML vuln.
damln
1
240
Rails et Heroku
damln
3
350
Capucine
damln
1
150
Other Decks in Programming
See All in Programming
フロントエンドとバックエンドで「1文字」を揃えよう
youkidearitai
PRO
0
750
不変条件と整合性境界—ビジネスが決める設計判断と実現パターン / Invariants and Consistency Boundaries
nrslib
14
5.9k
ADKを使って簡単にAIエージェントを作ってみよう
k1mu21
0
280
AIキャラアプリkaiwaの低遅延音声通話基盤をどう作ったか - AWS Gravitonで支える低遅延・低コストAI Agent基盤
mogamit
0
110
生成AI時代にこそ効くGo | Why Go Works in the Age of Generative AI
mom0tomo
8
3.3k
例外の正しい扱い方 そのエラー try-catchして大丈夫?
jinwatanabe
0
290
Signal Forms: Details & Live Coding @enterJS 2026 in Mannheim
manfredsteyer
PRO
0
200
技術的負債解消で開発者の未来を開く- AIの力でコード刷新
kmd2kmd
0
120
Datadog LLM Observabilityで実現する 安全なLLM Usage 管理
3150
0
120
Observability in Practice:Grafana 與 Edge Device SRE 的那些事
blueswen
0
180
Honoでのサプライチェーン侵害対策 〜 3つのライブラリに学ぶ
yusukebe
7
1.5k
肥大化するレガシーコードに立ち向かうためのインターフェース分離と依存の逆転 / JJUG CCC 2026 Spring
hirokunimaeta
0
640
Featured
See All Featured
How to Talk to Developers About Accessibility
jct
2
260
DBのスキルで生き残る技術 - AI時代におけるテーブル設計の勘所
soudai
PRO
66
55k
Into the Great Unknown - MozCon
thekraken
41
2.6k
Avoiding the “Bad Training, Faster” Trap in the Age of AI
tmiket
0
180
The Power of CSS Pseudo Elements
geoffreycrofte
82
6.3k
The B2B funnel & how to create a winning content strategy
katarinadahlin
PRO
1
400
StorybookのUI Testing Handbookを読んだ
zakiyama
31
6.8k
Un-Boring Meetings
codingconduct
0
320
Information Architects: The Missing Link in Design Systems
soysaucechin
0
980
Marketing Yourself as an Engineer | Alaka | Gurzu
gurzu
0
250
Exploring the relationship between traditional SERPs and Gen AI search
raygrieselhuber
PRO
2
4k
Heart Work Chapter 1 - Part 1
lfama
PRO
8
36k
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