14. The Twelve Factor App is…
• a manifesto
• a methodology
• a collection of experiences
15. Its goals are…
• scalability
• maintainability
• portability
16. Its does this through…
declarative setup
…explicit dependencies
…external configuration
!
clean contracts
…between your app and its platform
…reduced coupling
!
minimum divergence
…between each deployment
…between dev and prod environments
18. I. Codebase
One codebase, many deploys
Test
Staging
Production
19. I. Codebase
One codebase, many deploys
Test
Staging
Production
$ git push heroku-test master
$ git push heroku-stg master
$ git push heroku-prod master
31. IV. Backing Services
Treat backing services as attachable resources
$ heroku addons:add papertrail
32. V. Build, release, run
• A build step vendors dependencies, prepares assets, etc.
• A release step creates a package from build and config.
• A runtime step executes, without special knowledge.
38. VII. Port binding
• Export services via port binding
• Self-contained, not relying on runtime injection by a web server
java -Dserver.port=$PORT -jar …
41. VIII. Concurrency
web.2
web.1
worker.3
worker.1 clock.1
Workload Diversity
Number of Processes
worker.2
42. IX. Disposability
Fast startup and graceful shutdown
• Spring Boot and Play do this for you…
• as opposed to big App Servers that take several minutes to boot
43. X. Dev/prod parity
Keep dev, staging, prod and everything in between as similar as possible
44. X. Dev/prod parity
Keep dev, staging, prod and everything in between as similar as possible
dev!
sqlite!
postgres
stage!
mysql!
postgres
prod!
postgres!
postgres
=!
≠!
=
=!
≠!
=
50. Further reading…
!
Heroku DevCenter: devcenter.heroku.com
!
Spring Boot Example: https://github.com/kissaten/spring-boot-executable
!
Link to slideshare
!
Twitter: @codefinger
51. Thank You!
Joe Kutner
JVM Languages Owner at Heroku
@codefinger