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
PHPで学ぶプログラミングの教訓 / Lessons in Programming Learned through PHP
nrslib
2
210
クリエイティブコーディングとRuby学習 / Creative Coding and Learning Ruby
chobishiba
0
3.9k
LLM Supervised Fine-tuningの理論と実践
datanalyticslabo
4
1.1k
KubeCon + CloudNativeCon NA 2024 Overviewat Kubernetes Meetup Tokyo #68 / amsy810_k8sjp68
masayaaoyama
0
250
useSyncExternalStoreを使いまくる
ssssota
6
1k
これが俺の”自分戦略” プロセスを楽しんでいこう! - Developers CAREER Boost 2024
niftycorp
PRO
0
190
複雑な仕様に立ち向かうアーキテクチャ
myohei
0
170
CSC305 Lecture 26
javiergs
PRO
0
140
talk-with-local-llm-with-web-streams-api
kbaba1001
0
180
PHPUnitしか使ってこなかった 一般PHPerがPestに乗り換えた実録
mashirou1234
0
150
testcontainers のススメ
sgash708
1
120
Mermaid x AST x 生成AI = コードとドキュメントの完全同期への道
shibuyamizuho
0
160
Featured
See All Featured
For a Future-Friendly Web
brad_frost
175
9.4k
Building an army of robots
kneath
302
44k
Measuring & Analyzing Core Web Vitals
bluesmoon
4
170
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
44
9.3k
Rebuilding a faster, lazier Slack
samanthasiow
79
8.7k
Fontdeck: Realign not Redesign
paulrobertlloyd
82
5.3k
The Illustrated Children's Guide to Kubernetes
chrisshort
48
48k
VelocityConf: Rendering Performance Case Studies
addyosmani
326
24k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
28
9.1k
Into the Great Unknown - MozCon
thekraken
33
1.5k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
29
2k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
48
2.2k
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