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
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Damian Le Nouaille
April 04, 2012
Programming
270
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
180
Optimize or Die Tryin'
damln
1
240
Rails YAML vuln.
damln
1
240
Rails et Heroku
damln
3
350
Capucine
damln
1
150
Other Decks in Programming
See All in Programming
AIを上手に使っていこうとしたら越境せざるを得なくなった話 〜実践1年で見えた境界を越えなければならない理由と進め方〜 / Crossing borders with AI
tomoyakitaura
4
1.1k
業務時間外もAIに働いてもらう話
colorful12
3
10k
変化を抱擁するドキュメントの作り方 - ビジネスルール駆動開発がもたらす、コードとの新しい関係
ioki
2
120
LL言語やWebフレームワークのPostgreSQL対応 〜DBの機能がユーザーに届くまで〜
kentaroutakeda
0
140
Vibes Containers 〜AIで変わるコンテナ設計と運用〜
tkikuc
3
510
ハーネス設計入門 〜プロンプト、コンテキストの次〜
kinopeee
55
36k
30年振りにコンパイラの定数整数除算を改善した
herumi
9
4.5k
Hello, Hiroshima Geospatial Data! — Exploring DoboX with Python
ra0kley
0
180
RSSとCodexを使ってX投稿自動化してみた
ochtum
0
110
[DroidKaigi 2026] Bring your own phones to Gradle Managed Devices
f2lk
0
110
MIZARU@SPAJAM2026 第二回予選
1901drama
0
110
Hono + Inertia + React で LP を構築した話
oukayuka
2
220
Featured
See All Featured
Avoiding the “Bad Training, Faster” Trap in the Age of AI
tmiket
0
230
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
287
14k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
133
19k
Mobile First: as difficult as doing things right
swwweet
225
10k
The AI Search Optimization Roadmap by Aleyda Solis
aleyda
1
6.2k
What does AI have to do with Human Rights?
axbom
PRO
1
2.4k
Building Experiences: Design Systems, User Experience, and Full Site Editing
marktimemedia
0
600
The SEO identity crisis: Don't let AI make you average
varn
0
550
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
230
23k
Docker and Python
trallard
47
4.2k
How Software Deployment tools have changed in the past 20 years
geshan
1
34k
The innovator’s Mindset - Leading Through an Era of Exponential Change - McGill University 2025
jdejongh
PRO
1
320
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