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
Advanced Redis Techniques
Search
Russ Smith
March 13, 2013
Programming
3
670
Advanced Redis Techniques
Talk given at the Las Vegas Ruby Group.
Russ Smith
March 13, 2013
Tweet
Share
Other Decks in Programming
See All in Programming
Tool Catalog Agent for Bedrock AgentCore Gateway
licux
7
2.6k
LLMとPlaywright/reg-suitを活用した jQueryリファクタリングの実際
kinocoboy2
0
120
機能追加とリーダー業務の類似性
rinchoku
2
1.4k
Navigating Dependency Injection with Metro
zacsweers
3
5.7k
AndroidXR向けにアプリを作るには
kotambourine
0
120
テストカバレッジ100%を10年続けて得られた学びと品質
mottyzzz
2
620
「待たせ上手」なスケルトンスクリーン、 そのUXの裏側
teamlab
PRO
0
620
Compose Multiplatform × AI で作る、次世代アプリ開発支援ツールの設計と実装
thagikura
0
180
JSONataを使ってみよう Step Functionsが楽しくなる実践テクニック #devio2025
dafujii
1
680
1から理解するWeb Push
dora1998
7
2k
速いWebフレームワークを作る
yusukebe
5
1.8k
Swift Updates - Learn Languages 2025
koher
2
530
Featured
See All Featured
The Illustrated Children's Guide to Kubernetes
chrisshort
48
50k
GitHub's CSS Performance
jonrohan
1032
460k
Site-Speed That Sticks
csswizardry
10
830
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
35
3.1k
Thoughts on Productivity
jonyablonski
70
4.8k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
PRO
188
55k
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
252
21k
Principles of Awesome APIs and How to Build Them.
keavy
126
17k
Automating Front-end Workflow
addyosmani
1370
200k
jQuery: Nuts, Bolts and Bling
dougneiner
64
7.9k
Measuring & Analyzing Core Web Vitals
bluesmoon
9
590
Transcript
Advanced Redis Techniques
Redis is an open source, BSD licensed, 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.
the basics
ca16403c13fc9 46:count":902} {KEY:VALUE} {"von:counter s:downloads:
lists[milk,egg s,cereal,baco n,salt,plates, oranges,lettu
{name:‘bob’,em ail:‘bob@gmail .com’,passwor d:‘password’} hashsES
So what makes it different?
Deep structural awareness in the storage layer.
push, pop, sets, sorted sets, pub/Sub, unions, intersect, etc
so what about the cool kids
Resque Sidekiq Fnordmetric VON leaderboard instagram spool twitter
USE the built in data structures
LPUSH mylist ‘work’ LPOP mylist => ‘work’
hset myhash count 0 hincrby myhash count 1 hget myhash
count => 1
zadd myzset 1 “jim” zadd myzset 2 “bob” zrange myzset
0 -1
store only what you need
TWEETID:USERID
USE the pipeline FOR roflscale
redis.pipelined do redis.set(‘foo’, ‘bar’) redis.incr(‘baz’) end
Optimize what you are storing
SET user:1234 5678
* 3,000,000 = 21gb
HSET ‘users:100’ ‘1234’ ‘5689’
* 3,000,000 = 5gb
hash-max-zipmap-entries 256 hash-max-zipmap-value 1024
Shard the data
lpush ‘users:20130313’ ‘bob’
GETting REALLY nerdy
setbit activeusers:20130313 231 1 setbit activeusers:20130313 102 1
devops tips
Write the data to disk
save 60 1000
Replicate for high availability & redundancy
slaveof 10.0.0.3
use Sentinel for automatic failover
None