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
260
Five sharding data models and which is right? PGDay Nordic
craigkerstiens
0
170
Postgres at any scale
craigkerstiens
1
710
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
200
Postgres – A Data Platform
craigkerstiens
2
440
Other Decks in Programming
See All in Programming
Piniaの現状と今後
waka292
5
1.5k
Modern Angular: Renovation for Your Applications
manfredsteyer
PRO
0
210
Boost Performance and Developer Productivity with Jakarta EE 11
ivargrimstad
0
850
シールドクラスをはじめよう / Getting Started with Sealed Classes
mackey0225
3
400
Identifying User Idenity
moro
6
7.9k
Content Security Policy入門 セキュリティ設定と 違反レポートのはじめ方 / Introduction to Content Security Policy Getting Started with Security Configuration and Violation Reporting
uskey512
1
430
Vue.js学習の振り返り
hiro_xre
2
130
のびしろを広げる巻き込まれ力:偶然を活かすキャリアの作り方/oso2024
takahashiikki
1
410
RailsのPull requestsのレビューの時に私が考えていること
yahonda
5
1.7k
Generative AI Use Cases JP (略称:GenU)奮闘記
hideg
0
150
Go言語でターミナルフレンドリーなAIコマンド、afaを作った/fukuokago20_afa
monochromegane
2
140
2万ページのSSG運用における工夫と注意点 / Vue Fes Japan 2024
chinen
3
1.3k
Featured
See All Featured
Making the Leap to Tech Lead
cromwellryan
132
8.9k
Stop Working from a Prison Cell
hatefulcrawdad
267
20k
Making Projects Easy
brettharned
115
5.9k
Designing the Hi-DPI Web
ddemaree
280
34k
GraphQLとの向き合い方2022年版
quramy
43
13k
Documentation Writing (for coders)
carmenintech
65
4.4k
Principles of Awesome APIs and How to Build Them.
keavy
126
17k
YesSQL, Process and Tooling at Scale
rocio
167
14k
BBQ
matthewcrist
85
9.3k
Ruby is Unlike a Banana
tanoku
96
11k
Speed Design
sergeychernyshev
24
570
Producing Creativity
orderedlist
PRO
341
39k
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