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
Beyond Rails Server
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Michael Chen
November 17, 2012
Technology
1.1k
19
Share
Beyond Rails Server
For RubyConf China 2012
Michael Chen
November 17, 2012
More Decks by Michael Chen
See All by Michael Chen
Reconsider REST: 一种构建大型Rails应用的方式
mechiland
11
1.3k
Other Decks in Technology
See All in Technology
Kubernetesの「隠れメモリ消費」によるNode共倒れと、Request適正化という処方箋
g0xu
0
170
BIツール「Omni」の紹介 @Snowflake中部UG
sagara
0
110
GitHub Actions侵害 — 相次ぐ事例を振り返り、次なる脅威に備える
flatt_security
13
7.5k
やさしいとこから始めるGitHubリポジトリのセキュリティ
tsubakimoto_s
3
2.2k
「できない」のアウトプット 同人誌『精神を壊してからの』シリーズ出版を 通して得られたこと
comi190327
3
560
The essence of decision-making lies in primary data
kaminashi
0
240
Cursor Subagentsはいいぞ
yug1224
2
140
Podcast配信で広がったアウトプットの輪~70人と音声発信してきた7年間~/outputconf_01
fortegp05
0
220
Bref でサービスを運用している話
sgash708
0
220
AIエージェント時代に必要な オペレーションマネージャーのロールとは
kentarofujii
0
300
バックオフィスPJのPjMをコーポレートITが担うとうまくいく3つの理由
yueda256
1
260
【関西電力KOI×VOLTMIND 生成AIハッカソン】空間AIブレイン ~⼤阪おばちゃんフィジカルAIに続く道~
tanakaseiya
0
140
Featured
See All Featured
Self-Hosted WebAssembly Runtime for Runtime-Neutral Checkpoint/Restore in Edge–Cloud Continuum
chikuwait
0
440
技術選定の審美眼(2025年版) / Understanding the Spiral of Technologies 2025 edition
twada
PRO
118
110k
The Pragmatic Product Professional
lauravandoore
37
7.2k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
12
1.6k
SEO in 2025: How to Prepare for the Future of Search
ipullrank
3
3.4k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
231
54k
Getting science done with accelerated Python computing platforms
jacobtomlinson
2
160
Leading Effective Engineering Teams in the AI Era
addyosmani
9
1.8k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
333
22k
More Than Pixels: Becoming A User Experience Designer
marktimemedia
3
370
It's Worth the Effort
3n
188
29k
Embracing the Ebb and Flow
colly
88
5k
Transcript
Beyond `rails server` Rails全栈技术指南
陈金洲 @mechiland Picture taken by Michael Chen
部署 监控 架构演进
gem install rails
RVM
rails g scaffold
GET PUT POST DELETE show update create destroy SELECT UPDATE
INSERT DELETE Programming Model
rails server
None
“15分钟创建Blog” “24小时创建一个网站”
“15分钟创建Blog” “24小时创建一个网站”
“15分钟创建Blog” “24小时创建一个网站”
1. 部署
jinshuju.net
None
Browser Web Server App Server Database
Browser Web Server App Server Database ? ? ? ?
注册域名
‣ www.domain.com ‣ *.domain.com ‣ MX 记录 ‣ TXT 记录
域名
主机
备案
None
None
cannot find this picture source
Web, App, DB
硬件准备完毕…… jinshuju.net
Git master dev feature 1 feature 2
部署 cap deploy
除了CRUD resque + god cronjob + whenever
持续部署 DEV UAT PROD
2. 监控
[h]top
vmstat w uptime ps free iostat sar mpstat pmap netstat
ss iptraf tcpdump strace /proc
None
None
监控什么?
硬盘 www/db服务状态 Google Analytics CPU ⻚页⾯面响应时间 微博@ 内存 4xx/5xx⻚页⾯面 ⽤用户⾏行为数据
带宽 邮件队列 ……
硬盘 www/db服务状态 Google Analytics CPU ⻚页⾯面响应时间 微博@ 内存 4xx/5xx⻚页⾯面 ⽤用户⾏行为数据
带宽 邮件队列 可⽤用性影响逐渐减少 实际花费时间逐渐增加
3. 架构演进 http://www.flickr.com/photos/declicjardin/309583331
None
None
初始 Model View Controller DB
进行中 Model View Controller DB Model View Controller DB Model
View Controller DB
真实情况 Model View Controller DB Model View Controller DB Model
View Controller DB Model View Controller DB Model View Controller DB
JavaEE/.NET
Rails/Linux的方式 resque cronjob
‣ 前台进程、后台进程、cronjob ‣ 前台进程保证响应时间在可接受范 围之内(<200ms) ‣ 将耗时操作放入后台(delay_job, resque, sidekiq) ‣
善用cronjob(whenever)
代码行阈值 3000
随时准备应用剥离 Picture taken by Michael Chen
核⼼心应⽤用 domain.com
核⼼心应⽤用 domain.com 核⼼心部分 domain.com ⽀支付 payments.domain.com
核⼼心应⽤用 domain.com 核⼼心部分 domain.com ⽀支付 payments.domain.com 核⼼心部分 domain.com ⽀支付 payments.domain.com
⽤用户管理 my.domain.com
‣ 将架构演进视作正常行为 ‣ 警惕代码行数 ‣ 随时准备剥离,进行进程分离 ‣ 为引入新技术做好准备
X. 免费赠送 http://www.flickr.com/photos/rtv/2269548635
B2B Go B2b, B2C
rubygems.org
not just What It’s about How and Why
部署 实现持续部署 监控 监控应用行为 架构演进 警惕规模变大 Beyond `rails server`
谢谢! @mechiland 陈金洲 http://michael.nona.name