Cutting through
Cloud-Native Complexity

... with Rock, Paper, Scissors

Was heißt cloud-native?

Was heißt cloud-native?

Was heißt cloud-native?

Was heißt cloud-native?

Was heißt cloud-native?

Was heißt cloud-native?


Anwendungen die in der
Cloud laufen können

Warum cloud-native?

API - Rock, Paper Scissors

Wie sieht das Deployment
ohne Cloud aus?

Wie sieht das Deployment
ohne Cloud aus?

  • Server / Hardware
  • Netzwerk
  • Port Freigaben
  • Betriebssystem / Updates
  • Ressourcen
  • Umgebungen?

Was ist mit der eigentlichen Anwendung?

Servers are not pets,
they are cattle

Wie sieht das Deployment
in der Cloud aus?

Wie sieht das Deployment
in der Cloud aus?

  • Fokus auf Anwendung
  • Skalierbarkeit
  • Resilienz
  • Robustheit
  • Sicherheit
  • Kurze Time-to-Market

... keine Besonderheit mehr sondern normal

Cloud-native
in der Entwicklung

Cloud-native
in der Entwicklung

2012 - The Twelve Factor App


2016 - Beyond the Twelve Factor App

The 12-Factor-App and Beyond

  • One Codebase, One App
  • API First
  • Design, Build, Release, Run
  • Backing Services
  • Environment Parity
  • Administrative Processes
  • Port Binding
  • Stateless Processes
  • Authentication and Authorization
  • ...

The 12-Factor-App and Beyond

  • One Codebase, One App
  • API First
  • Design, Build, Release, Run
  • Backing Services
  • Environment Parity
  • Administrative Processes
  • Port Binding
  • Stateless Processes
  • Authentication and Authorization
  • Configuration, Credentials, Code
  • Dependency Management
  • Logs
  • Concurrency
  • Disposability
  • Telemetry

menti.com

2129 7245

The 12-Factor-App and Beyond

  • One Codebase, One App
  • API First
  • Design, Build, Release, Run
  • Backing Services
  • Environment Parity
  • Administrative Processes
  • Port Binding
  • Stateless Processes
  • Authentication and Authorization

Zum Fazit

Configuration, Credentials, Code


Behandle Konfiguration, Zugangsdaten und Code als würden sie explodieren, wenn man sie mischt.
- Beyond Twelve Factors


Welche Konsequenzen hätte es den Source Code öffentlich zu machen?
- Beyond Twelve Factors


Configuration, Credentials, Code


application.properties
...
db.url=${JDBC_URL}
server.port=${PORT}
...

Configuration, Credentials, Code


Code

+ Credentials / Configuration

= Deployment

Back

Dependency Management

  • Abhängigkeiten explizit ausdrücken
  • Keine Annahmen zu Abhängigkeiten treffen

Dependency Management

pom.xml
... <dependencies> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </dependency> ... </dependencies> ...
> mvn clean install
Back

Logs

Keine Annahmen über Dateisystem!

→ Logs sind zeitlich geordnete Event Streams

Logs

Logs

Beispiel Google Cloud
Back

Concurrency

Mehr Nebenläufigkeit ist immer eine zuverlässige Option.
- Beyond Twelve Factors

Concurrency

Concurrency

Concurrency

  • Dynamische Skalierbarkeit
  • Handling von Bottlenecks
  • Kosten sparen
Back

Disposability

Wann ist meine Anwendung bereit Requests
entgegen zu nehmen?

  • Liveness
  • Readiness

Disposability

Spring Actuator

... <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-actuator</artifactId> </dependency> ...

management.endpoint.health.probes.enabled=true management.health.livenessState.enabled=true management.health.readinessState.enabled=true

Disposability

/actuator/health
{ "status": "UP", "components": { "diskSpace": { "status": "UP", "details": {} }, "livenessState": { "status": "UP" }, "ping": { "status": "UP" }, "readinessState": { "status": "UP" } }, "groups": [ "liveness", "readiness" ] }

Back

Telemetry

Spring Actuator

... <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-actuator</artifactId> </dependency> <dependency> <groupId>io.micrometer</groupId> <artifactId>micrometer-registry-prometheus</artifactId> </dependency> ...
/actuator/prometheus
# HELP jvm_buffer_total_capacity_bytes An estimate of the total capacity of the buffers in this pool # TYPE jvm_buffer_total_capacity_bytes gauge jvm_buffer_total_capacity_bytes{id="mapped - 'non-volatile memory'",} 0.0 jvm_buffer_total_capacity_bytes{id="mapped",} 0.0 jvm_buffer_total_capacity_bytes{id="direct",} 1.8419719E7 # HELP jvm_memory_max_bytes The maximum amount of memory in bytes that can be used for memory management # TYPE jvm_memory_max_bytes gauge jvm_memory_max_bytes{area="nonheap",id="CodeHeap 'profiled nmethods'",} 1.21729024E8 jvm_memory_max_bytes{area="heap",id="G1 Survivor Space",} -1.0 jvm_memory_max_bytes{area="heap",id="G1 Old Gen",} 1.073741824E9 jvm_memory_max_bytes{area="nonheap",id="Metaspace",} -1.0 jvm_memory_max_bytes{area="nonheap",id="CodeHeap 'non-nmethods'",} 8196096.0 jvm_memory_max_bytes{area="heap",id="G1 Eden Space",} -1.0 jvm_memory_max_bytes{area="nonheap",id="Compressed Class Space",} 1.073741824E9 jvm_memory_max_bytes{area="nonheap",id="CodeHeap 'non-profiled nmethods'",} 1.2173312E8 ...

Back

Fazit

Fazit

  • Was ist cloud-native?
  • Warum sollte mich das interessieren?

  • Twelve Factor App / Beyond Twelve Factor

  • Was ist bei der Entwicklung zu beachten?

crossnative.github.io/soko-rps