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
職位にかかわらず全員がリーダーシップを発揮するチーム作り / Building a team where everyone can demonstrate leadership, regardless of position
madoxten
13
6.7k
サイト信頼性エンジニアリングとAmazon Web Services / SRE and AWS
ymotongpoo
7
1.8k
データベースの負荷を紐解く/untangle-the-database-load
emiki
2
550
入門 PEAK Threat Hunting @SECCON
odorusatoshi
0
180
困難を「一般解」で解く
fujiwara3
8
2.3k
2/18 Making Security Scale: メルカリが考えるセキュリティ戦略 - Coincheck x LayerX x Mercari
jsonf
0
260
データモデルYANGの処理系を再発明した話
tjmtrhs
0
330
"TEAM"を導入したら最高のエンジニア"Team"を実現できた / Deploying "TEAM" and Building the Best Engineering "Team"
yuj1osm
1
240
エンジニア主導の企画立案を可能にする組織とは?
recruitengineers
PRO
1
310
AIエージェント開発のノウハウと課題
pharma_x_tech
9
4.9k
x86-64 Assembly Essentials
latte72
4
450
株式会社Awarefy(アウェアファイ)会社説明資料 / Awarefy-Company-Deck
awarefy
3
12k
Featured
See All Featured
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
44
7.1k
Imperfection Machines: The Place of Print at Facebook
scottboms
267
13k
Six Lessons from altMBA
skipperchong
27
3.6k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
507
140k
Rails Girls Zürich Keynote
gr2m
94
13k
Visualization
eitanlees
146
15k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
28
9.3k
How to train your dragon (web standard)
notwaldorf
91
5.9k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
49
2.3k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
129
19k
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
3.7k
Build your cross-platform service in a week with App Engine
jlugia
229
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日星期⼀一