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
System Operations for Startup - Software
Search
Gea-Suan Lin
July 23, 2012
Technology
15
6.1k
System Operations for Startup - Software
Gea-Suan Lin
July 23, 2012
Tweet
Share
More Decks by Gea-Suan Lin
See All by Gea-Suan Lin
High Availability Vault Service on AWS Environment
gslin
0
6.9k
用 AWS CodeDeploy 解決程式佈署
gslin
0
380
MySQL to NoSQL & Search Engine
gslin
0
2k
用 Vagrant 與 Docker 拯救世界
gslin
1
240
Startup IT infrastructure: Developing and Working with AWS
gslin
8
3.5k
Talk about Percona XtraDB Cluster
gslin
0
170
API Design Optimized for Mobile Platform
gslin
9
8.4k
Use Facebook::Graph to write desktop application
gslin
2
490
COSCUP 2012 - MySQL System Stability
gslin
17
12k
Other Decks in Technology
See All in Technology
近年の PyCon 情勢から見た PyCon APAC のまとめ
terapyon
0
290
改めて学ぶ Trait の使い方 / phpcon odawara 2025
meihei3
1
560
Creating Awesome Change in SmartNews
martin_lover
1
240
食べログが挑む!飲食店ネット予約システムで自動テスト無双して手動テストゼロを実現する戦略
hagevvashi
1
160
Рекомендации с нуля: как мы в Lamoda превратили главную страницу в ключевую точку входа для персонализированного шоппинга. Данил Комаров, Data Scientist, Lamoda Tech
lamodatech
0
290
YOLOv10~v12
tenten0727
3
860
アジャイル脅威モデリング#1(脅威モデリングナイト#8)
masakane55
3
160
Zabbixチョットデキルとは!?
kujiraitakahiro
0
180
Beyond {shiny}: The Future of Mobile Apps with R
colinfay
1
370
Would you THINK such a demonstration interesting ?
shumpei3
1
160
“パスワードレス認証への道" ユーザー認証の変遷とパスキーの関係
ritou
1
430
Langchain4j y Ollama - Integrando LLMs con programas Java @ Commit Conf 2025
deors
1
130
Featured
See All Featured
Building Better People: How to give real-time feedback that sticks.
wjessup
367
19k
Making Projects Easy
brettharned
116
6.1k
Why Our Code Smells
bkeepers
PRO
336
57k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
34
2.2k
Why You Should Never Use an ORM
jnunemaker
PRO
55
9.3k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
280
13k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
29
1.6k
Docker and Python
trallard
44
3.3k
Code Reviewing Like a Champion
maltzj
522
39k
Music & Morning Musume
bryan
47
6.5k
BBQ
matthewcrist
88
9.6k
Fontdeck: Realign not Redesign
paulrobertlloyd
83
5.5k
Transcript
System Operations for Startup - Second Part Gea-Suan Lin, KKBOX
Inc. 2012-07-23 12年7月23日星期⼀一
Then we talk about software part 12年7月23日星期⼀一
• Programming • Web Server • Database • Cache 12年7月23日星期⼀一
Programming 12年7月23日星期⼀一
There are two things important 12年7月23日星期⼀一
First, 12年7月23日星期⼀一
Don’t fight with framework 12年7月23日星期⼀一
Think about why framework design it this way 12年7月23日星期⼀一
Second, 12年7月23日星期⼀一
Internet is dirty People are evil 12年7月23日星期⼀一
Input data are dirty 12年7月23日星期⼀一
Use whitelist to filter 12年7月23日星期⼀一
UTF-8 validation 12年7月23日星期⼀一
Uploaded data validation 12年7月23日星期⼀一
Format validation (Regular expression ?) 12年7月23日星期⼀一
Escape when necessary 12年7月23日星期⼀一
Don’t write plain SQL 12年7月23日星期⼀一
SELECT * FROM user WHERE username = “${username}”; 12年7月23日星期⼀一
Boom ! 12年7月23日星期⼀一
Escape when necessary 12年7月23日星期⼀一
XSS issue 12年7月23日星期⼀一
Remember, 12年7月23日星期⼀一
幹壞事是進步最大的 原動力 12年7月23日星期⼀一
People always try to hack your site 12年7月23日星期⼀一
Web Server 12年7月23日星期⼀一
• Apache • Lighttpd • nginx 12年7月23日星期⼀一
Apache 12年7月23日星期⼀一
Don’t use prefork MPM 12年7月23日星期⼀一
Thread MPM is fine 12年7月23日星期⼀一
Reasonable speed 12年7月23日星期⼀一
And everybody loves .htaccess 12年7月23日星期⼀一
Lighttpd 12年7月23日星期⼀一
No feature update for a long time 12年7月23日星期⼀一
Forget it 12年7月23日星期⼀一
nginx 12年7月23日星期⼀一
Extreme fast for static files (assets) 12年7月23日星期⼀一
Really fast 12年7月23日星期⼀一
Conclusion 12年7月23日星期⼀一
Split static files (assets) into another domain 12年7月23日星期⼀一
Use nginx to serve your static files (assets) 12年7月23日星期⼀一
Profiling your bottleneck 12年7月23日星期⼀一
If web server is bottleneck, use nginx 12年7月23日星期⼀一
Otherwise, use Apache 12年7月23日星期⼀一
Database 12年7月23日星期⼀一
• MySQL • NoSQL 12年7月23日星期⼀一
MySQL 12年7月23日星期⼀一
We won’t introduce MySQL 12年7月23日星期⼀一
Just remind serveral things important 12年7月23日星期⼀一
Use InnoDB 12年7月23日星期⼀一
Always InnoDB 12年7月23日星期⼀一
Yes, InnoDB 12年7月23日星期⼀一
And, 12年7月23日星期⼀一
Don’t use MyISAM 12年7月23日星期⼀一
You won’t like table lock 12年7月23日星期⼀一
You won’t like to repair tables 12年7月23日星期⼀一
Percona modified version is great 12年7月23日星期⼀一
Why InnoDB ? 12年7月23日星期⼀一
Transaction ACID 12年7月23日星期⼀一
Writes won’t block reads 12年7月23日星期⼀一
Fast recovery after server crash 12年7月23日星期⼀一
Consistent backup without downtime 12年7月23日星期⼀一
Compression 12年7月23日星期⼀一
It’s possible smaller than MyISAM tables 12年7月23日星期⼀一
High availability solutions requirement 12年7月23日星期⼀一
DRBD + Heartbeat 12年7月23日星期⼀一
Mature technology 12年7月23日星期⼀一
Quite stable 12年7月23日星期⼀一
Active-Standby Lower utilization rate 12年7月23日星期⼀一
Master-Master based on async replication 12年7月23日星期⼀一
Active-Active Higher utilization rate 12年7月23日星期⼀一
But notice data consistency issue 12年7月23日星期⼀一
Galera Cluster 12年7月23日星期⼀一
Young project 12年7月23日星期⼀一
Active-Active Higher utilization rate 12年7月23日星期⼀一
Sync replication without data consistent issue 12年7月23日星期⼀一
Conclusion 12年7月23日星期⼀一
MySQL works 12年7月23日星期⼀一
And there are lots of minefields 12年7月23日星期⼀一
But those minefields can be workaround 12年7月23日星期⼀一
RAM is cheap 12年7月23日星期⼀一
16GB RAM is quite large 12年7月23日星期⼀一
64GB RAM is quite large 12年7月23日星期⼀一
288GB RAM is quite large 12年7月23日星期⼀一
512GB RAM is quite large 12年7月23日星期⼀一
Data larger than 512GB ? 12年7月23日星期⼀一
... 12年7月23日星期⼀一
We can discuss privately ? 12年7月23日星期⼀一
NoSQL 12年7月23日星期⼀一
General concept 12年7月23日星期⼀一
NoSQL Need is (usually) Performance Need 12年7月23日星期⼀一
What kind of programming language will perform better ? 12年7月23日星期⼀一
C 12年7月23日星期⼀一
“Portable Assembly” 12年7月23日星期⼀一
Choose C-based written NoSQL first 12年7月23日星期⼀一
Another concept 12年7月23日星期⼀一
Story begin when data growing out of memory... 12年7月23日星期⼀一
Many stories about data out of memory 12年7月23日星期⼀一
Of course not happy stories 12年7月23日星期⼀一
So, list some good NoSQL 12年7月23日星期⼀一
Redis 12年7月23日星期⼀一
Key-Value Store 12年7月23日星期⼀一
Focus on key-value store 12年7月23日星期⼀一
Not claiming scalability 12年7月23日星期⼀一
Because they know hot data needs to fit memory 12年7月23日星期⼀一
Other NoSQL ? 12年7月23日星期⼀一
Sorry, no idea... 12年7月23日星期⼀一
There are so many PR-oriented NoSQL software 12年7月23日星期⼀一
Remember, 12年7月23日星期⼀一
Story begin when data growing out of memory... 12年7月23日星期⼀一
Cache 12年7月23日星期⼀一
Important note 12年7月23日星期⼀一
Cache only when you need to 12年7月23日星期⼀一
Because invalidation is not easy 12年7月23日星期⼀一
So, 12年7月23日星期⼀一
Always profiling 12年7月23日星期⼀一
• Frontend Cache • Backend Cache 12年7月23日星期⼀一
Frontend Cache 12年7月23日星期⼀一
HTTP Header 12年7月23日星期⼀一
Cache-Control 12年7月23日星期⼀一
Avoid ETags 12年7月23日星期⼀一
CDN 12年7月23日星期⼀一
Don’t use CDN before you do profile 12年7月23日星期⼀一
YSlow 12年7月23日星期⼀一
Google PageSpeed 12年7月23日星期⼀一
Backend Cache 12年7月23日星期⼀一
Memcached 12年7月23日星期⼀一
Remember Memcached is just a cache server 12年7月23日星期⼀一
Memcached may crash 12年7月23日星期⼀一
Use it as cache server 12年7月23日星期⼀一
Because it’s cache layer 12年7月23日星期⼀一
Cache Layer ! 12年7月23日星期⼀一
Your site should be able to work without cache 12年7月23日星期⼀一
Database Cache 12年7月23日星期⼀一
MySQL Query Cache 12年7月23日星期⼀一
Trun off it 12年7月23日星期⼀一
Because it’s not efficient on multi-CPU environment 12年7月23日星期⼀一
Instead, 12年7月23日星期⼀一
Use index correctly 12年7月23日星期⼀一
Make sure all time-sensitive queries use correct index 12年7月23日星期⼀一
Index optimization is engine dependent 12年7月23日星期⼀一
Understand B+tree will help you 12年7月23日星期⼀一
Remember one thing: 12年7月23日星期⼀一
MySQL is stupid 12年7月23日星期⼀一
If you cannot find an efficient way to query, 12年7月23日星期⼀一
Then MySQL can’t either 12年7月23日星期⼀一
Conclusion 12年7月23日星期⼀一
Profiling first, then decide what to cache 12年7月23日星期⼀一
Remember, 12年7月23日星期⼀一
Premature optimization is the root of all evil 12年7月23日星期⼀一
Summarize 12年7月23日星期⼀一
Find out problem Analyze problem Then solve problem 12年7月23日星期⼀一
Thanks ! 12年7月23日星期⼀一
Any questions ? 12年7月23日星期⼀一