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
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Russ Smith
March 13, 2013
Programming
670
3
Share
Advanced Redis Techniques
Talk given at the Las Vegas Ruby Group.
Russ Smith
March 13, 2013
Other Decks in Programming
See All in Programming
Smarter Angular mit Transformers.js & Prompt API
christianliebel
PRO
1
110
The free-lunch guide to idea circularity
hollycummins
0
390
PHP 7.4でもOpenTelemetryゼロコード計装がしたい! / PHPerKaigi 2026
arthur1
1
450
実践ハーネスエンジニアリング #MOSHTech
kajitack
7
5.2k
PHP でエミュレータを自作して Ubuntu を動かそう
m3m0r7
PRO
2
150
Nuxt Server Components
wattanx
0
220
AWS×クラウドネイティブソフトウェア設計 / AWS x Cloud-Native Software Design
nrslib
16
3.5k
Laravel Nightwatchの裏側 - Laravel公式Observabilityツールを支える設計と実装
avosalmon
1
280
Xdebug と IDE による デバッグ実行の仕組みを見る / Exploring-How-Debugging-Works-with-Xdebug-and-an-IDE
shin1x1
0
290
ファインチューニングせずメインコンペを解く方法
pokutuna
0
230
最初からAWS CDKで技術検証してもいいんじゃない?
akihisaikeda
4
180
モックわからないマン卒業記 ~振る舞いを起点に見直した、フロントエンドテストにおけるモックの使いどころ~
tasukuwatanabe
3
430
Featured
See All Featured
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
55
3.3k
svc-hook: hooking system calls on ARM64 by binary rewriting
retrage
2
190
Google's AI Overviews - The New Search
badams
0
950
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
10
1.1k
Max Prin - Stacking Signals: How International SEO Comes Together (And Falls Apart)
techseoconnect
PRO
0
140
Building a Scalable Design System with Sketch
lauravandoore
463
34k
How to Ace a Technical Interview
jacobian
281
24k
Applied NLP in the Age of Generative AI
inesmontani
PRO
4
2.2k
Ten Tips & Tricks for a 🌱 transition
stuffmc
0
94
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
194
17k
What the history of the web can teach us about the future of AI
inesmontani
PRO
1
500
Collaborative Software Design: How to facilitate domain modelling decisions
baasie
0
180
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