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
370
MySQL to NoSQL & Search Engine
gslin
0
1.9k
用 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
480
COSCUP 2012 - MySQL System Stability
gslin
17
12k
Other Decks in Technology
See All in Technology
【Forkwell】「正しく」失敗できるチームを作る──現場のリーダーのための恐怖と不安を乗り越える技術 - FL#83 / A team that can fail correctly by forkwell
i35_267
2
140
【5分でわかる】セーフィー エンジニア向け会社紹介
safie_recruit
0
19k
IAMのマニアックな話2025
nrinetcom
PRO
6
1.5k
Two Blades, One Journey: Engineering While Managing
ohbarye
4
2.8k
「頑張る」を「楽しむ」に変換する技術
tomoyakitaura
1
310
どちらかだけじゃもったいないかも? ECSとEKSを適材適所で併用するメリット、運用課題とそれらの対応について
tk3fftk
2
310
Log Analytics を使った実際の運用 - Sansan Data Hub での取り組み
sansantech
PRO
0
150
いまからでも遅くない!コンテナでWebアプリを動かしてみよう!コンテナハンズオン編
nomu
0
190
4th place solution Eedi - Mining Misconceptions in Mathematics
rist
0
150
アジリティを高めるテストマネジメント #QiitaQualityForward
makky_tyuyan
1
490
JavaにおけるNull非許容性
skrb
2
2.8k
OPENLOGI Company Profile
hr01
0
60k
Featured
See All Featured
A Philosophy of Restraint
colly
203
16k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
44
7.1k
The Art of Programming - Codeland 2020
erikaheidi
53
13k
Principles of Awesome APIs and How to Build Them.
keavy
126
17k
Fontdeck: Realign not Redesign
paulrobertlloyd
83
5.4k
RailsConf 2023
tenderlove
29
1k
Building an army of robots
kneath
303
45k
Building Your Own Lightsaber
phodgson
104
6.2k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
280
13k
Making Projects Easy
brettharned
116
6k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
366
25k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
100
18k
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日星期⼀一