Upgrade to Pro — share decks privately, control downloads, hide ads and more …

12 Factor App

12 Factor App

12 Factor Application talk given at Cloud East

Craig Kerstiens

June 28, 2012
Tweet

More Decks by Craig Kerstiens

Other Decks in Programming

Transcript

  1. Where We’ve Been Version Control | Dependency Management | Build

    Release Folders SVN,Perforce,Source Safe Git,Mercurial
  2. Version Control | Dependency Management | Build Release Where We’ve

    Been $ python setup.py install $ ruby setup.rb install
  3. Version Control | Dependency Management | Build Release Where We’ve

    Been $ python setup.py install $ ruby setup.rb install $ INSTALL FROM SOURCE
  4. Version Control | Dependency Management | Build Release $ pip

    install -r requirements.txt $ bundle install Now
  5. Version Control | Dependency Management | Build Release $ pip

    install -r requirements.txt $ bundle install Now $ INSTALL PINNED VERSIONS
  6. Declarative Setup - Minimize Setup Time Clean Contracts - Portability

    Deploy Practices - Cloud and horizontal scaling 12 Factor
  7. Declarative Setup - Minimize Setup Time Clean Contracts - Portability

    Deploy Practices - Cloud and horizontal scaling Minimize Divergence - Continuous Deployment 12 Factor
  8. dev = staging Dev-Prod Parity Dev Prod Parity | Config

    | Concurrency | Backing Services | Logs
  9. dev = staging = prod Dev-Prod Parity Dev Prod Parity

    | Config | Concurrency | Backing Services | Logs
  10. dev = staging = prod sqlite postgres postgres Dev-Prod Parity

    Dev Prod Parity | Config | Concurrency | Backing Services | Logs
  11. dev = staging = prod sqlite postgres postgres Dev-Prod Parity

    Dev Prod Parity | Config | Concurrency | Backing Services | Logs ≠ ≠
  12. dev = staging = prod sqlite postgres postgres postgres =

    postgres = postgres Dev-Prod Parity Dev Prod Parity | Config | Concurrency | Backing Services | Logs ≠ ≠
  13. Config var server=”servername” var username=”username” var password=”password” var dbname =

    “dname” Dev Prod Parity | Config | Concurrency | Backing Services | Logs
  14. Config (External to your code) Dev Prod Parity | Config

    | Concurrency | Backing Services | Logs
  15. 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
  16. web.1 web.2 Scale Processes Dev Prod Parity | Config |

    Concurrency | Backing Services | Logs
  17. web.1 web.2 worker.1 clock.1 Workload Diversity Scale Processes Dev Prod

    Parity | Config | Concurrency | Backing Services | Logs
  18. 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
  19. Backing Services Dev Prod Parity | Config | Concurrency |

    Backing Services | Logs Stateless Processes
  20. Backing Services Dev Prod Parity | Config | Concurrency |

    Backing Services | Logs Stateless Processes External Config
  21. 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
  22. How we use logs $ ssh tomyserver $ cat access_log

    Logs Dev Prod Parity | Config | Concurrency | Backing Services | Logs
  23. 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
  24. DB Web Worker Logs Dev Prod Parity | Config |

    Concurrency | Backing Services | Logs
  25. Event Stream DB Web Worker Logs Dev Prod Parity |

    Config | Concurrency | Backing Services | Logs
  26. 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