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

12 Factor Applications

12 Factor Applications

A talk about 12 Factor Application manifesto, describing the factors, how they evolved and new factors for "modern" applications and infrastructures.

Yeray Darias

April 23, 2019
Tweet

More Decks by Yeray Darias

Other Decks in Programming

Transcript

  1. 2016 2014 Kubernetes 2012 2007 H eroku 2006 AW S

    12 Factor Apps Beyond 12 Factor Apps 2019
  2. "dependencies": { "@types/app-root-path": "^1.2.4", "@types/lodash": "^4.14.123", "@types/mongodb": "^3.1.22", "@types/node": "^11.13.0",

    "app-root-path": "^2.2.1", "lodash": "^4.17.11", "moment": "^2.24.0", "mongodb": "^3.2.2", "winston": "^3.2.1" }
  3. “Organizations ... are constrained to produce designs which are copies

    of the communication structures of these organizations” Conway’s law
  4. spring: datasource: url: jdbc:h2:~/development username: sa password: driver-class-name: org.h2.Driver ---

    spring.profiles: staging spring: datasource: url: jdbc:postgresql://sl-us-south-1-portal.50.dblayer.com:15843/my-db username: db-user password: m1passw0rdm0l0n driver-class-name: org.postgresql.Driver
  5. spring: datasource: url: jdbc:h2:~/development username: sa password: driver-class-name: org.h2.Driver ---

    spring.profiles: staging spring: datasource: url: jdbc:postgresql://sl-us-south-1-portal.50.dblayer.com:15843/my-db username: ${DB-USERNAME} password: ${DB-PASSWORD} driver-class-name: org.postgresql.Driver
  6. apiVersion: autoscaling/v2beta1 kind: HorizontalPodAutoscaler metadata: name: {{ .Release.Name }}-autoscaling labels:

    app: {{ .Release.Name }} spec: scaleTargetRef: apiVersion: apps/v1 kind: Deployment name: {{ .Release.Name }}-deployment minReplicas: {{ .Values.replicaCount }} maxReplicas: {{ .Values.replicaMax }}
  7. “One-off admin processes should be run in an identical environment

    as the regular long-running processes of the app”
  8. “They run against a release, using the same code and

    config as any process run against that release”
  9. public float calculatePolarityOf(Argument argument) { var decoratedSupplier = CircuitBreaker.decorateCheckedSupplier( circuitBreaker,

    () -> innerPolarityCalculationOf(argument)); var decoratedRetrier = Retry.decorateCheckedSupplier( retry, decoratedSupplier); return Try.of(decoratedRetrier).getOrElse(0f); }
  10. @HystrixCommand(fallbackMethod = "reliable") public String readingList() { URI uri =

    URI.create("http://localhost:8090/recommended"); return this.restTemplate.getForObject(uri, String.class); } public String reliable() { return "Cloud Native Java (O'Reilly)"; }
  11. • Stateless process • Single repository per application • Configuration

    • Dependencies • Backing services • Build, release, run • Administrative processes ?