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
データの品質が低いと何が困るのか
kzykmyzw
6
1.1k
現場の種を事業の芽にする - エンジニア主導のイノベーションを事業戦略に装着する方法 -
kzkmaeda
2
2.1k
ビジネスモデリング道場 目的と背景
masuda220
PRO
9
550
RSNA2024振り返り
nanachi
0
580
一度 Expo の採用を断念したけど、 再度 Expo の導入を検討している話
ichiki1023
1
170
スタートアップ1人目QAエンジニアが QAチームを立ち上げ、“個”からチーム、 そして“組織”に成長するまで / How to set up QA team at reiwatravel
mii3king
2
1.5k
デスクトップだけじゃないUbuntu
mtyshibata
0
140
管理者しか知らないOutlookの裏側のAIを覗く#AzureTravelers
hirotomotaguchi
2
430
地方拠点で エンジニアリングマネージャーってできるの? 〜地方という制約を楽しむオーナーシップとコミュニティ作り〜
1coin
1
230
明日からできる!技術的負債の返済を加速するための実践ガイド~『ホットペッパービューティー』の事例をもとに~
recruitengineers
PRO
3
410
オブザーバビリティの観点でみるAWS / AWS from observability perspective
ymotongpoo
8
1.5k
データマネジメントのトレードオフに立ち向かう
ikkimiyazaki
6
1k
Featured
See All Featured
Designing Dashboards & Data Visualisations in Web Apps
destraynor
231
53k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
330
21k
Principles of Awesome APIs and How to Build Them.
keavy
126
17k
For a Future-Friendly Web
brad_frost
176
9.5k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
PRO
12
960
A designer walks into a library…
pauljervisheath
205
24k
GitHub's CSS Performance
jonrohan
1030
460k
Git: the NoSQL Database
bkeepers
PRO
427
64k
Testing 201, or: Great Expectations
jmmastey
42
7.2k
KATA
mclloyd
29
14k
How To Stay Up To Date on Web Technology
chriscoyier
790
250k
Gamification - CAS2011
davidbonilla
80
5.1k
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日星期⼀一