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
フォーイット_エンジニア向け会社紹介資料_Forit_Company_Profile.pdf
forit_tech
1
1.7k
Two Blades, One Journey: Engineering While Managing
ohbarye
4
2.3k
クラウド関連のインシデントケースを収集して見えてきたもの
lhazy
9
1.8k
大規模アジャイルフレームワークから学ぶエンジニアマネジメントの本質
staka121
PRO
3
1.4k
LINE NEWSにおけるバックエンド開発
lycorptech_jp
PRO
0
330
JavaにおけるNull非許容性
skrb
2
2.7k
1行のコードから社会課題の解決へ: EMの探究、事業・技術・組織を紡ぐ実践知 / EM Conf 2025
9ma3r
12
4.4k
Snowflakeの開発・運用コストをApache Icebergで効率化しよう!~機能と活用例のご紹介~
sagara
1
500
事業モメンタムを生み出すプロダクト開発
macchiitaka
0
100
Aurora PostgreSQLがCloudWatch Logsに 出力するログの課金を削減してみる #jawsdays2025
non97
1
230
遷移の高速化 ヤフートップの試行錯誤
narirou
6
1.8k
2025/3/1 公共交通オープンデータデイ2025
morohoshi
0
100
Featured
See All Featured
Fontdeck: Realign not Redesign
paulrobertlloyd
83
5.4k
The Invisible Side of Design
smashingmag
299
50k
Building an army of robots
kneath
303
45k
For a Future-Friendly Web
brad_frost
176
9.6k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
30
4.6k
Measuring & Analyzing Core Web Vitals
bluesmoon
6
260
Navigating Team Friction
lara
183
15k
Principles of Awesome APIs and How to Build Them.
keavy
126
17k
Building Applications with DynamoDB
mza
93
6.2k
Site-Speed That Sticks
csswizardry
4
410
Producing Creativity
orderedlist
PRO
344
40k
Typedesign – Prime Four
hannesfritz
41
2.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日星期⼀一