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
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Damian Le Nouaille
April 04, 2012
Programming
260
4
Share
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
230
Rails et Heroku
damln
3
350
Capucine
damln
1
150
Other Decks in Programming
See All in Programming
3Dシーンの圧縮
fadis
1
570
フロントエンドとバックエンドで「1文字」を揃えよう
youkidearitai
PRO
0
130
Migrations : C'est une question d'hygiène !
vinceamstoutz
0
2.9k
Lemonade + Foundry Toolkit でお手軽アプリ開発
seosoft
1
260
権限チェックの一貫性を型で守る TypeScript による多層防御
mnch
4
1k
JJUG CCC 2026 Spring: JSpecify で実現する Kotlin フレンドリーな Java API 設計
ternbusty
1
130
Java × distroless で 軽量なコンテナイメージを / Java on Distroless
contour_gara
0
460
気づいたらRubyで100作品 ー クリエイティブコーディングが生活の一部になるまで / 100 Ruby Sketches Later: How Creative Coding Became Part of My Life
chobishiba
3
530
RTSPクライアントを自作してみた話
simotin13
0
420
「エンジニアインターン、どうやって取った?」準備のリアルを語るLT会 Progate BAR
akiomatic
0
110
自動レビューエンジンの実装と運用 ~レビューのない世界へ~
kurukuru1999
2
310
プロパティの順序で型推論が壊れる!? TypeScript6.0の修正からContext-Sensitivityの仕組みを追う
bicstone
2
1.3k
Featured
See All Featured
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
122
22k
Have SEOs Ruined the Internet? - User Awareness of SEO in 2025
akashhashmi
0
360
Chasing Engaging Ingredients in Design
codingconduct
0
200
Code Review Best Practice
trishagee
74
20k
DBのスキルで生き残る技術 - AI時代におけるテーブル設計の勘所
soudai
PRO
65
55k
Imperfection Machines: The Place of Print at Facebook
scottboms
270
14k
Introduction to Domain-Driven Design and Collaborative software design
baasie
1
810
AI: The stuff that nobody shows you
jnunemaker
PRO
7
680
Exploring the relationship between traditional SERPs and Gen AI search
raygrieselhuber
PRO
2
4k
We Have a Design System, Now What?
morganepeng
55
8.2k
A Tale of Four Properties
chriscoyier
163
24k
StorybookのUI Testing Handbookを読んだ
zakiyama
31
6.8k
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