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
12 Factor App
Search
Craig Kerstiens
June 28, 2012
Programming
12
1.1k
12 Factor App
12 Factor Application talk given at Cloud East
Craig Kerstiens
June 28, 2012
Tweet
Share
More Decks by Craig Kerstiens
See All by Craig Kerstiens
Product planning w/ gridding - Effort vs. Impact rule of thirds
craigkerstiens
0
270
Five sharding data models and which is right? PGDay Nordic
craigkerstiens
0
170
Postgres at any scale
craigkerstiens
1
740
Five data models for sharding and which is right
craigkerstiens
0
110
Postgres Performance for Humans - All things Open
craigkerstiens
1
260
Postgres Performance for Humans - PyCaribbean
craigkerstiens
1
130
Postgres present and future
craigkerstiens
1
330
Marketing for Developers
craigkerstiens
0
210
Postgres – A Data Platform
craigkerstiens
2
440
Other Decks in Programming
See All in Programming
Итераторы в Go 1.23: зачем они нужны, как использовать, и насколько они быстрые?
lamodatech
0
770
コンテナをたくさん詰め込んだシステムとランタイムの変化
makihiro
1
130
Go の GC の不得意な部分を克服したい
taiyow
3
790
20年もののレガシープロダクトに 0からPHPStanを入れるまで / phpcon2024
hirobe1999
0
480
Zoneless Testing
rainerhahnekamp
0
120
ゆるやかにgolangci-lintのルールを強くする / Kyoto.go #56
utgwkk
2
390
PHPで作るWebSocketサーバー ~リアクティブなアプリケーションを知るために~ / WebSocket Server in PHP - To know reactive applications
seike460
PRO
2
370
【re:Growth 2024】 Aurora DSQL をちゃんと話します!
maroon1st
0
780
今年のアップデートで振り返るCDKセキュリティのシフトレフト/2024-cdk-security-shift-left
tomoki10
0
200
Security_for_introducing_eBPF
kentatada
0
110
nekko cloudにおけるProxmox VE利用事例
irumaru
3
430
DevFest Tokyo 2025 - Flutter のアプリアーキテクチャ現在地点
wasabeef
5
910
Featured
See All Featured
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
356
29k
Building an army of robots
kneath
302
44k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
PRO
10
810
Testing 201, or: Great Expectations
jmmastey
40
7.1k
jQuery: Nuts, Bolts and Bling
dougneiner
61
7.5k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
44
6.9k
Making the Leap to Tech Lead
cromwellryan
133
9k
Building a Modern Day E-commerce SEO Strategy
aleyda
38
7k
Making Projects Easy
brettharned
116
5.9k
Stop Working from a Prison Cell
hatefulcrawdad
267
20k
The Pragmatic Product Professional
lauravandoore
32
6.3k
Done Done
chrislema
181
16k
Transcript
12 Factor App
Craig Kerstiens @craigkerstiens work at @heroku
First Some History
Where We’ve Been Version Control | Dependency Management | Build
Release
Where We’ve Been Version Control | Dependency Management | Build
Release Folders
Where We’ve Been Version Control | Dependency Management | Build
Release Folders SVN,Perforce,Source Safe
Where We’ve Been Version Control | Dependency Management | Build
Release Folders SVN,Perforce,Source Safe Git,Mercurial
Version Control | Dependency Management | Build Release Now
Version Control | Dependency Management | Build Release Now 1
Code base Many deploys
Version Control | Dependency Management | Build Release Now 1
Code base Many deploys
Version Control | Dependency Management | Build Release Now 1
Code base Many deploys
Version Control | Dependency Management | Build Release Where We’ve
Been
Version Control | Dependency Management | Build Release Where We’ve
Been $ python setup.py install $ ruby setup.rb install
Version Control | Dependency Management | Build Release Where We’ve
Been $ python setup.py install $ ruby setup.rb install $ INSTALL FROM SOURCE
Version Control | Dependency Management | Build Release Now
Version Control | Dependency Management | Build Release $ pip
install -r requirements.txt $ bundle install Now
Version Control | Dependency Management | Build Release $ pip
install -r requirements.txt $ bundle install Now $ INSTALL PINNED VERSIONS
Version Control | Dependency Management | Build Release Where We’ve
Been
$ rsync myproject tomyserver Version Control | Dependency Management |
Build Release Where We’ve Been
Version Control | Dependency Management | Build Release Now
Version Control | Dependency Management | Build Release Now
Version Control | Dependency Management | Build Release Now
Enough History
12 Factor
Declarative Setup - Minimize Setup Time 12 Factor
Declarative Setup - Minimize Setup Time Clean Contracts - Portability
12 Factor
Declarative Setup - Minimize Setup Time Clean Contracts - Portability
Deploy Practices - Cloud and horizontal scaling 12 Factor
Declarative Setup - Minimize Setup Time Clean Contracts - Portability
Deploy Practices - Cloud and horizontal scaling Minimize Divergence - Continuous Deployment 12 Factor
Dev-Prod Parity Dev Prod Parity | Config | Concurrency |
Backing Services | Logs
dev Dev-Prod Parity Dev Prod Parity | Config | Concurrency
| Backing Services | Logs
dev = staging Dev-Prod Parity Dev Prod Parity | Config
| Concurrency | Backing Services | Logs
dev = staging = prod Dev-Prod Parity Dev Prod Parity
| Config | Concurrency | Backing Services | Logs
dev = staging = prod sqlite postgres postgres Dev-Prod Parity
Dev Prod Parity | Config | Concurrency | Backing Services | Logs
dev = staging = prod sqlite postgres postgres Dev-Prod Parity
Dev Prod Parity | Config | Concurrency | Backing Services | Logs ≠ ≠
dev = staging = prod sqlite postgres postgres postgres =
postgres = postgres Dev-Prod Parity Dev Prod Parity | Config | Concurrency | Backing Services | Logs ≠ ≠
Config Dev Prod Parity | Config | Concurrency | Backing
Services | Logs
Config var server=”servername” var username=”username” var password=”password” var dbname =
“dname” Dev Prod Parity | Config | Concurrency | Backing Services | Logs
Config Dev Prod Parity | Config | Concurrency | Backing
Services | Logs
Config (External to your code) Dev Prod Parity | Config
| Concurrency | Backing Services | Logs
Config (External to your code) var server=ENV[‘server’] var username=ENV[‘username’] var
password=ENV[‘password’] var dbname = ENV[‘dbname’] Dev Prod Parity | Config | Concurrency | Backing Services | Logs
Processes Dev Prod Parity | Config | Concurrency | Backing
Services | Logs
web.1 Processes Dev Prod Parity | Config | Concurrency |
Backing Services | Logs
web.1 web.2 Processes Dev Prod Parity | Config | Concurrency
| Backing Services | Logs
web.1 web.2 Scale Processes Dev Prod Parity | Config |
Concurrency | Backing Services | Logs
web.1 web.2 worker.1 clock.1 Workload Diversity Scale Processes Dev Prod
Parity | Config | Concurrency | Backing Services | Logs
web.1 web.2 worker.1 worker.2 worker.3 worker.4 clock.1 Workload Diversity Scale
Processes Dev Prod Parity | Config | Concurrency | Backing Services | Logs
Backing Services Dev Prod Parity | Config | Concurrency |
Backing Services | Logs
Backing Services Dev Prod Parity | Config | Concurrency |
Backing Services | Logs Stateless Processes
Backing Services Dev Prod Parity | Config | Concurrency |
Backing Services | Logs Stateless Processes External Config
Backing Services Dev Prod Parity | Config | Concurrency |
Backing Services | Logs Stateless Processes External Config DATABASE_URL=postgres://username:pass@host/db MEMCACHE_URL=username:pass@host/db
Logs Dev Prod Parity | Config | Concurrency | Backing
Services | Logs
How we use logs $ ssh tomyserver $ cat access_log
Logs Dev Prod Parity | Config | Concurrency | Backing Services | Logs
How we use logs $ ssh tomyserver $ cat access_log
How we perceive logs $ tail -f access_log Logs Dev Prod Parity | Config | Concurrency | Backing Services | Logs
Logs Dev Prod Parity | Config | Concurrency | Backing
Services | Logs
DB Logs Dev Prod Parity | Config | Concurrency |
Backing Services | Logs
DB Web Logs Dev Prod Parity | Config | Concurrency
| Backing Services | Logs
DB Web Worker Logs Dev Prod Parity | Config |
Concurrency | Backing Services | Logs
Event Stream DB Web Worker Logs Dev Prod Parity |
Config | Concurrency | Backing Services | Logs
Event Stream 2012-02-22T19:56:40+00:00 [postgres]: .... 2012-02-22T19:56:40+00:00 [router]: GET mysite.com/ ...
2012-02-22T19:56:40+00:00 [nginx]: .... 2012-02-22T19:56:40+00:00 [worker]: .... DB Web Worker Logs Dev Prod Parity | Config | Concurrency | Backing Services | Logs
12 Factor
Declarative Setup Clean Contracts Deploy Practices Minimize Divergence 12 Factor
Fin. Resources http://craigkerstiens.com http://speakerdeck.com/u/craigkerstiens http://www.12factor.net