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
720
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
Snowflake x dbtで作るセキュアでアジャイルなデータ基盤
tsoshiro
2
520
ECS Service Connectのこれまでのアップデートと今後のRoadmapを見てみる
tkikuc
2
250
Remix on Hono on Cloudflare Workers
yusukebe
1
300
OnlineTestConf: Test Automation Friend or Foe
maaretp
0
110
最新TCAキャッチアップ
0si43
0
190
Realtime API 入門
riofujimon
0
150
レガシーシステムにどう立ち向かうか 複雑さと理想と現実/vs-legacy
suzukihoge
14
2.2k
Amazon Bedrock Agentsを用いてアプリ開発してみた!
har1101
0
340
C++でシェーダを書く
fadis
6
4.1k
Ethereum_.pdf
nekomatu
0
460
AI時代におけるSRE、 あるいはエンジニアの生存戦略
pyama86
6
1.2k
見せてあげますよ、「本物のLaravel批判」ってやつを。
77web
7
7.8k
Featured
See All Featured
The Cost Of JavaScript in 2023
addyosmani
45
6.8k
Typedesign – Prime Four
hannesfritz
40
2.4k
YesSQL, Process and Tooling at Scale
rocio
169
14k
A Tale of Four Properties
chriscoyier
156
23k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
26
2.1k
Java REST API Framework Comparison - PWX 2021
mraible
PRO
28
8.2k
Principles of Awesome APIs and How to Build Them.
keavy
126
17k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
506
140k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
29
2.3k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
PRO
10
720
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
42
9.2k
Designing the Hi-DPI Web
ddemaree
280
34k
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