Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Redis: based on real story
Search
Poga Po
March 31, 2012
Programming
1.4k
16
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Redis: based on real story
Talk @ NoSQL Taiwan
Poga Po
March 31, 2012
More Decks by Poga Po
See All by Poga Po
Spacer - iThome Serverless All-Star
poga
2
320
civic-notebook
poga
0
120
Fuzz Testing and go-fuzz
poga
0
410
everything is log
poga
12
1.9k
g0v intro
poga
0
120
新聞產生器
poga
0
730
RESTful API @ Front-End Developers Taiwan 2014-04-23
poga
3
230
Dependency Management in Go
poga
4
680
Other Decks in Programming
See All in Programming
Long Living Tokens, Die, Die, Die! (or: The One Ring is Banned in Modern)
sylph01
0
330
ソニーのクラウド共通基盤の変遷とAI時代の開発スタイルに合わせた進化 / The Journey of Sony’s Common Cloud Platform and Its Evolution for AI-Native Development
kenjiyoneyama
0
280
ActionController meets Protocol Buffers
sorah
0
560
[2026-10-09]一枚の布で作らなくてもいい。 信頼性は「パッチワーク」で紡がれる~既存の運用と新しい可能性をつなぎ合わせてきたCREの話~
tosite
0
100
[JA] Domain Modeling with Vanilla Rails: 「操作」から再考するRailsの設計論
yasaichi
3
480
コードで差別化できない時代の ソフトウェアエンジニアリング / Software Engineering in an Era Where Code Doesn’t Differentiate
kishida
2
180
re:Inventに行く前に知っておきたい現地参加のノウハウ
nokomoro3
0
440
IBM Bob でAI駆動開発『QC-Playbook』
ichirokano2
0
110
Apple Intelligence を用いた個人情報誤送信防止、及びユーザーリクエスト体験の改善について
yukiny
0
350
作って学ぶSpring BootのAuto Configuration / JJUG Night Seminar 2026-10-19
rshindo
0
190
golang-bob.pdf
iwatsukayura
0
130
作れる、でも消せるか?──安全に「枯らして消す」機能削除術 / Drain, Then Delete
chobishiba
2
830
Featured
See All Featured
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
360
31k
Into the Great Unknown - MozCon
thekraken
41
2.8k
Mind Mapping
helmedeiros
1
400
More Than Pixels: Becoming A User Experience Designer
marktimemedia
3
570
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
12
1.3k
How to Grow Your eCommerce with AI & Automation
katarinadahlin
PRO
2
330
Scaling GitHub
holman
464
140k
Discover your Explorer Soul
emna__ayadi
2
1.3k
From π to Pie charts
rasagy
1
400
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
31
10k
16th Malabo Montpellier Forum Presentation
akademiya2063
PRO
0
410
Why Your Marketing Sucks and What You Can Do About It - Sophie Logan
marketingsoph
0
430
Transcript
Poga 2012.03.31 based on real story
Hi 你好 Hallo 안녕 ciao salut こんにちは
i Poga
i wear many hats
i wear many hats build products
Product released PARTY? Let’s
Database CPU Utilization
Performance Degrading = Unhappy User = Less Profit
Complex Queries Inefficient schema
Limited Time
None
Just ADD it to your stack
Just ADD it to your stack Not Replace
Special Performance Simple In-memory Atomic
Special Performance Simple In-memory Atomic
Management Problem a.k.a. “We don’t have a MIS”
Dependency Feb 25, 2009 First public beta Oct 14, 2011
Redis 2.4 First external dependency jemalloc Mar 31, 2012
Installation Feb 25, 2009 First public beta Oct 14, 2011
Redis 2.4 First external dependency jemalloc Mar 31, 2012 make install make install
Stable
None
Special Performance Simple In-memory Atomic
Special Performance Simple In-memory Atomic
In-Memory Memcached High Performance Simple Key-Value Redis In-Memory High Performance
Data Structures Persistence Replication ...
Data Structures List, Set, Sorted Set, Hash, String http://redis.io/commands
Understand your problem http://nosql.mypopescu.com/post/18977451039/redis-guide-what-each-redis-data-type-should-be-used Every command in Redis is manipulating
a data structure
Special Performance Simple In-memory Atomic
Special Performance Simple In-memory Atomic
=
http://redis.io/topics/benchmarks FAST for real
Special Performance Simple In-memory Atomic
No Race Condition every command in redis is atomic use
redis as a incremental counter “There are very few systems that support an “increment and return” operation, and Redis is one of them (Oracle sequences are another).” http://nateware.com/2010/02/18/an-atomic-rant/
No Race Condition every command in redis is atomic Combine
multiple command: still atomic! MULTI SET key 123 SET key2 456 EXEC Warning: Don’t confuse with transaction
Special Performance Simple In-memory Atomic
i
Did I make any changes to MySQL? NO It’s still
our main database
Did I solve the problem? YES solve complex queries via
Redis data structure
Happy Database Add Redis to stack
How? Sorted Set: Per user notification String: API request limiter
String, List: Request logging List: Job Queue
Real World = Risk Persistence Replication Sharding
Persistence RDB AOF
RDB • Snapshot • Compact • .rdb file can be
transfered to other backup system • Chances to lose data
AOF • logs of every write operation • durable •
bigger file size
You want a degree of safety comparable to PostgreSQL? Just
use BOTH
Replication Master Slave Slave Slave
Replication • Read-only salves • Save on slaves
Sharding • Memory is limited • Split data into multiple
redis servers
Presharding Single Machine Redis instance Redis instance Redis instance Redis
instance Redis instance Redis instance Redis instance Redis instance Redis instance Redis instance Multiple Machine
Some Case Study • Resque • Rubygems.org • Tumblr •
Instagram
Resque High Performance Job Queue https://github.com/blog/542-introducing-resque
Rubygems.org http://www.scribd.com/doc/34269414/Redis-Persistence-Power feature switch API request limit Logging Job Queue
Tumblr http://engineering.tumblr.com/post/7819252942/staircar-redis-powered-notifications Per-user Notification 30,000 request/s per server
Instagram http://engineering.tumblr.com/post/7819252942/staircar-redis-powered-notifications Simple Key-value mapping 1/3 cost on hardware
Cross server temporary file sharing i Redis string is binary-safe
Future
Future Lua Scripting Watchdog
Lua Scripting Atomic Saving bandwidth between servers
Ruby Redis Sum up 200,000 values ... 200,000 times
Ruby Redis Sum up 200,000 values, with Lua scripting 1
request
Data Model Query Language Scripting MySQL Redis Relational Table SQL
Data Structures Lua Lua
Watchdog Let Redis monitor itself Like slow queries in MySQL
More information to diagnose problem
Bright Future Lua Scripting Watchdog
= Unique
Unique = Not replacing anyone Job security of other database
What will u get
More life less cost Happy User
Thank you question? @devpoga