SlideShare ist ein Scribd-Unternehmen logo
1 von 255
Downloaden Sie, um offline zu lesen
#WISSENTEILEN
Cloud Architekuren
Von „less Server“ zu Serverless
Lars Röwekamp | open knowledge GmbH
@_openKnowledge | @mobileLarson
ÜBER OPEN KNOWLEDGE
Branchenneutrale Softwareentwicklung & IT-Beratung
ÜBER MICH
Wer bin ich - und wenn ja, wie viele?
• CIO New Technologies
• Enterprise & Mobile
• Autor, Speaker, Coach & Mentor
• Snowboard & MTB Enthusiast (a.k.a. “stets bemüht“)
Lars Röwekamp (a.k.a. @mobileLarson)
Mein Server
und ich ...
Mein Server
und ich ...
„The Nightmare“
#WISSENTEILEN
Server Q&A„Dinge, über die ich mir Gedanken machen sollte!“
#WISSENTEILEN
#Servers:
#Customer:
#Traffic:
#Security:
Anzahl? OS? Storage? CPU? Memory?
Start small! Grow fast! Die faster?
Moderat, aber mit Peaks?
OS? Patches? Access Control?
“We have to be great at a number of things…
operating data centers is not one of those things.”
I had a
dream ...
#WISSENTEILEN
#LaborCost:
#Risk:
#ResourceCost:
#Scaling:
#LeadTime:
DIY? Nein, danke!
Risiko liegt zu 100% beim Provider
nur zahlen, was ich nutze
on-the-fly Up- und Down-Scaling
neue System stehen „sofort“ zur Verfügung
„Kein Server ist
einfacher zu
verwalten, als
kein Server.“
(Werner Vogels, CTO Amazon)
out-of-the-box self-scaling
out-of-the-box
self-scaling
cloud-based
super-backend
I had a dream ...
Aber warum
ICH?
#1
Agilität
#2
Plattform
#3
Kosten
#4
Innovationen
“We are a hospitality management
organization, not an IT services company.”
80 Mio Gäste / 1500 EC2
„We have a 5 person operations team.”
„Kein Server ist
einfacher zu
verwalten, als
kein Server.“
(Werner Vogels, CTO Amazon)
SERVERLESS
The Road to
less Server?
The Road to the Cloud ...
Der Serverless Showcase
Road to less Server
IaaS
Road to less Server
Road to less Server
Self-Managed Cloud-Managed
Road to less Server
Self-Managed Cloud-Managed
Provisioning
Security
Maintenance
Road to less Server
Self-Managed Cloud-Managed
Provisioning
Security
Maintenance
Road to less Server
Sieht irgendwie kompliziert
aus! Muss ich mich darum
kümmern?
Self-Managed Cloud-Managed
Provisioning
Security
Maintenance
Road to less Server
Self-Managed Cloud-Managed
Elastic
Beanstalk
Elastic
Kubernetes
Elastic
Container
Provisioning
Security
Maintenance
Scaling
Road to less Server
IaaS
(Infrastructure as a Service)
EBS: elastic beanstalk
Road to less Server
IaaS
(Infrastructure as a Service)
ECS : elastic container service
Road to less Server
IaaS
(Infrastructure as a Service)
EKS : elastic container service for kubernetes
IaaS
Road to less Server
IaaSPaaS
Road to less Server
Road to less Server
Self-Managed Cloud-Managed
Provisioning
Security
Maintenance
Scaling
Road to less Server
Self-Managed Cloud-Managed
Provisioning
Security
Backup/Recovery
Scaling
Provisioning
Security
Maintenance
Scaling
Road to less Server
IaaS
(Infrastructure as a Service)
Road to less Server
PaaS
(Platform as a Service)
IaaSPaaS
Road to less Server
Business Logic
(... as a Service)
Das Versprechen
von Serverless
“Run YOUR business
code in the cloud.“
Das klappt niemals!
Das klappt niemals!
Warum nicht?
Das klappt niemals!
Warum nicht?
Na, weil es
DEIN
Business
Code ist!
IaaSPaaS
Road to less Server
PaaS IaaS
Road to less Server
Road to less Server
Self-Managed Cloud-Managed
Provisioning
Security
Backup/Recovery
Scaling
Provisioning
Security
Maintenance
Scaling
Road to less Server
Self-Managed Cloud-Managed
API Key Mgmt
Throtteling
Zero-Downtime
Region Availability
Provisioning
Security
Backup/Recovery
Scaling
Provisioning
Security
Maintenance
Scaling
Road to less Server
PaaS
(Platform as a Service)
Road to less Server
PaaS
(Platform as a Service)
Road to less Server
BaaS
(Backend as a Service)
Road to less Server
BaaS
(Backend as a Service)
Road to less Server
BaaS
(Backend as a Service)
PaaS IaaS
Road to less Server
?
PaaS IaaS
Road to less Server
#WISSENTEILEN
“Run your business code
highly-available
in the cloud in response
to events and scale
without any servers to
manage.“*
* AWS Lambda Advertising
#1:
Run your
business code
#2:
No servers to
provision or manage
#3:
Build in high availability
and disaster recovery
#4:
Scale with usage
by design
Management:
“Hmm, ich bin noch
nicht überzeugt!.”
#5:
Never pay idle
(Management: „Ok, I bin definitiv dabei!“)
„Kein Server ist
einfacher zu
verwalten, als
kein Server.“
(Werner Vogels, CTO Amazon)
out-of-the-box self-scaling
out-of-the-box
self-scaling
cloud-based
super-backend
Remember
„your“ dreams?
My Logic
(... as a Service)
Function
(... as a Service)
Functions als Basis für
Deployment
& Skalierung
Road to less Server
PaaS
(Platform as a Service)
Road to less Server
FaaS
(Function as a Service)
Run Code,
not Server?
No machines, VMs,
or containers.
*... are visible in the programing model
Big
Players?
AWS
Lambda Microsoft
Azure Functions
Oracle Functions
a.k.a. Project FN***
IBM Cloud Functions
a.k.a Apache OpenWhisk**
Google Cloud
Functions
Project Riff
sponsored by Pivotal
Serverless in a Nutshell
Was ist die Idee
von Serverless?
#WISSENTEILEN
Function as self-contained application
Serverless Function: Entwickler schreibt eine Business-
Funktion in einer der unterstützen Programmiersprachen,
„bundled“ diese mit den entsprechenden Abhängigkeiten
(LIBs) und lädt sie in die Cloud.
Serverless Environment: Führt die Funktion bei „Aufruf“ in
der passenden Runtime effizient, flexibel und hoch skalierbar
aus.
“
#WISSENTEILEN
Serverless no need to maintain
Entwickler: Fokussiert sich ausschließlich auf die
Umsetzung der Business-Logik und das Erstellen des
Function-Bundle.
Cloud Provider: liefert und maintained rundum-sorglos
Umgebung für die Serverless Functions, inklusive etwaiger
Cloud Services (z.B. Storage, DB, Streaming, AI).
“
> Hands-On
AWS Cloud
1
trigger
request
Hands-on: Hello World
AWS Cloud
hello world serverless context
1
trigger
request
Hands-on: Hello World
AWS Cloud
hello world serverless context
HelloWorld
Logs
1
trigger
request
2
Hands-on: Hello World
Was passiert da
unter der Haube?
1
trigger
request
Hello World „under the Hood“
AWS Cloud
HelloWorld
ZIP
1
trigger
request
Hello World „under the Hood“
Download
Function Code
ZIP
Cloud Storage
S3
AWS Cloud
2
HelloWorld
ZIP
1
trigger
request
Hello World „under the Hood“
Download
Function Code
Setup
Runtime
ZIP
Cloud Storage
S3
AWS Cloud
2 3
HelloWorld
ZIP
1
trigger
request
Hello World „under the Hood“
Download
Function Code
Setup
Runtime
Init
Function
ZIP
Cloud Storage
S3
AWS Cloud
2 3 4
HelloWorld
ZIP
1
trigger
request
Hello World „under the Hood“
Download
Function Code
Setup
Runtime
Init
Function
ZIP
Cloud Storage
S3
AWS Cloud
2 3 4
COLD START
trigger
request
Hello World „under the Hood“
Download
Function Code
ZIP
AWS Cloud
Setup
Runtime
Init
Function
COLD START
trigger
request
Hello World „under the Hood“
Download
Function Code
ZIP
AWS Cloud
Setup
Runtime
Init
Function
COLD START
Execute
Handler
trigger
request
Hello World „under the Hood“
Download
Function Code
ZIP
AWS Cloud
Setup
Runtime
Init
Function
COLD START
Execute
Handler
Terminate
Function
trigger
request
Hello World „under the Hood“
ZIP
AWS Cloud
COLD START
Terminate
Function
Execute
Handler
trigger
request
Hello World „under the Hood“
ZIP
AWS Cloud
COLD START
Terminate
Function
Execute
Handler
Execute
Handler
trigger
request
trigger
request
Hello World „under the Hood“
ZIP
AWS Cloud
COLD START
Execute
Handler
Terminate
Function
Execute
Handler
Execute
Handler
trigger
request
trigger
request
Serverless
Szenarien
Szenario
#1
Szenario #1: Datei-/Datenbearbeitung
Datei- oder Datenbearbeitung nach Ablage im S3 Storage System
• Bildbearbeitung
• Thumbnail-Erzeugung
• PDF-Generierung
AWS Cloud
Szenario #1: Datei-/Datenbearbeitung
1
upload
image
AWS Cloud
Szenario #1: Datei-/Datenbearbeitung
1 2
upload
image
AWS Cloud
Store raw Image
Szenario #1: Datei-/Datenbearbeitung
StoreImage
Logs
1 2
3
upload
image
AWS Cloud
Store raw Image
Szenario #1: Datei-/Datenbearbeitung
StoreImage
Logs
S3 Object
created1 2
3
4
upload
image
AWS Cloud
Store raw Image
Szenario #1: Datei-/Datenbearbeitung
StoreImage
Logs
S3 Object
created1 2
3
4
upload
image
AWS Cloud
Create ThumbnailStore raw Image
Szenario #1: Datei-/Datenbearbeitung
StoreImage
Logs
CreateThumbnail
Logs
S3 Object
created1 2
3
4
5
upload
image
> File Processing
Szenario #1: Lessons Learned
Was wir bisher gelernt haben …
• S3 ist der Platz zur Ablage von Objekten in AWS
• S3 benötigt spezielle Zugriffsrechte
• S3 triggert automatisch Cloud Events an
• Filter innerhalb der Lambda können S3 Event Trigger gezielt
einschränken, z.B. für
• Buckets
• Prefix / Postfix,
• IAM Nutzer / Rollen
Szenario
#2
Szenario #2: Stream Processing
Regelmäßiges abarbeiten von Streaming Data
• Social Media Trendanalysen
• Sensor Data Monitoring / Anomaly Detection
AWS Cloud
1
sensor data stream is
uploaded to Kinesis
in real-time
Szenario #2: Stream Processing
tons of
very important
sensor data
AWS Cloud
1
sensor data stream is
uploaded to Kinesis
in real-time
Szenario #2: Stream Processing
tons of
very important
sensor data
AWS Cloud
Data Stream Analysis
StreamAnalyzer
Logs
1
sensor data stream is
uploaded to Kinesis
in real-time
2
Lambda runs code to
detect anomalies
Szenario #2: Stream Processing
tons of
very important
sensor data
AWS Cloud
Data Stream Analysis
StreamAnalyzer
Logs
store anomalies
extracted by lambda
function
1
sensor data stream is
uploaded to Kinesis
in real-time
2
3
Lambda runs code to
detect anomalies
Szenario #2: Stream Processing
tons of
very important
sensor data
AWS Cloud
Data Stream Analysis
StreamAnalyzer
Logs
Real-Time Monitoring / Querying
store anomalies
extracted by lambda
function
1
sensor data stream is
uploaded to Kinesis
in real-time
2
3
Lambda runs code to
detect anomalies
4
data immediately
available for interested
parties to query
Szenario #2: Stream Processing
tons of
very important
sensor data
> Stream Processing
Szenario #3: Lessons Learned
Was wir bisher gelernt haben…
• Kinesis erlaubt die Bearbeitung von Data / Media Stream
• Kinesis benötigt spezielle Zugriffsrechte
• Lambdas können Chunks eines Kinesis Streams bearbeiten
• Lambdas in Verbindung mit Kinesis können genutzt werden, um …
• Metriken zu erzeugen
• Fehler / Anomalien zu erkennen
• Media Trends zu analysieren
Szenario
#3
Szenario #3: Web Application
Serverless „all in“ einer Anwendung…
• Ausliefern von statischem Content via CDN
• Authentication / Autorization via BaaS
• Businesslogik via FaaS (unter Verwendung von PaaS)
Szenario #3: Web Application
AWS Cloud
Web Client
region aware
web app
delivery
1
Szenario #3: Web Application
AWS Cloud
Web Client
region aware
web app
delivery
1
login via id/pwd
returns JWT
2
Szenario #3: Web Application
AWS Cloud
Web Client
region aware
web app
delivery
1
login via id/pwd
returns JWT
2
3
REST
call
Szenario #3: Web Application
AWS Cloud
Web Client
region aware
web app
delivery
1
login via id/pwd
returns JWT
2
3
REST
call
4
translated
lambda
trigger
Szenario #3: Web Application
AWS Cloud
Web Client
storage related functions
region aware
web app
delivery
1
login via id/pwd
returns JWT
2
3
REST
call
4
translated
lambda
trigger
5
lambda
@work
Szenario #3: Web Application
AWS Cloud
Web Client
storage related functions
database related functions
region aware
web app
delivery
1
login via id/pwd
returns JWT
2
3
REST
call
4
translated
lambda
trigger
5
lambda
@work
5
lambda
@work
Szenario #3: Web Application
AWS Cloud
Web Client
storage related functions
database related functions
additional functions, e.g.
region aware
web app
delivery
1
login via id/pwd
returns JWT
2
6
3
REST
call
4
translated
lambda
trigger
5
lambda
@work
5
lambda
@work
The Road to the Cloud ...
Der Serverless Showcase
Web Image Gallery
(easy version)
GET ../images/{imageId}
PUT ../images/{imageId}
DELETE ../images/{imageId}
POST ../images/
Web Image Gallery
(not so easy version)
GET ../images/{imageId}
PUT ../images/{imageId}
DELETE ../images/{imageId}
POST ../images/
Web Image Gallery
(real life version)
GET ../images/{imageId}
PUT ../images/{imageId}
DELETE ../images/{imageId}
POST ../images/
Szenario #3: Lessons Learned
Was wir bisher gelernt haben …
• CloudFront und S3 zur Web App Auslieferung (statischer Content)
• Cognito zur User Authentication via JWT
• Ketten von async / lose gekoppelten Lambdas
• Gateway dient als eine Art Function Dispatcher (plus …)
Szenario #3: Lessons Learned
Was wir bisher gelernt haben …
• CloudFront und S3 zur Web App Auslieferung (statischer Content)
• Cognito zur User Authentication via JWT
• Ketten von async / lose gekoppelten Lambdas
• Layer zur Mehrfachnutzung von Libraries in Lambdas
• Gateway dient als eine Art Function Dispatcher (plus …)
?
Szenario
#4
Scenarios
#3
API Gateway
AWS Cloud
Wofür ist ein API Gateway gut?
• Security
• API Key Handling
• Throttling
• Proxying
• Logging / Tracing
• Request / Respons Mapping
• Staging
AWS Cloud
1
Szenario #4: API Gateway
GET ../resources/{resourceId}
PUT ../resources/{resourceId}
DELETE ../resources/{resourceId}
POST ../resources/
AWS Cloud
Szenario #4: API Gateway
21
GET ../resources/{resourceId}
PUT ../resources/{resourceId}
DELETE ../resources/{resourceId}
POST ../resources/
AWS Cloud
read
create
delete
update
21
Szenario #4: API Gateway
3
GET ../resources/{resourceId}
PUT ../resources/{resourceId}
DELETE ../resources/{resourceId}
POST ../resources/
AWS Cloud
read
create
delete
update
Szenario #4: API Gateway
56 4
GET ../resources/{resourceId}
PUT ../resources/{resourceId}
DELETE ../resources/{resourceId}
POST ../resources/
> API Gateway
Szenario #4: Lessons Learned
Was wir bisher gelernt haben ...
• ein API Gateway „schützt“ die Cloud vor der Außenwelt
• HTTP Requests werden in Lambda Trigger überführt
• HTTP Parameter / Payload wird auf Lambda Events gemappt
• Lambda Results werden in HTTP Status Codes überführt
• Lambda Result Objekte werden auf HTTP Payload gemapped
• API Gateways kann ein Staging-Konzpt realisieren
Reality Check
The Road to the Cloud ...
Der Serverless Showcase
AWS Cloud
Use-Case: Upload Image
upload image
with additional
information
AWS Cloud
Store raw Image
1
Use-Case: Upload Image
upload image
with additional
information
AWS Cloud
Store raw Image
Store Image Information
1
2
Use-Case: Upload Image
upload image
with additional
information
AWS Cloud
AWS Step Functions workflow: Store Image
Store raw Image
Store Image Information
1
2
Use-Case: Upload Image
upload image
with additional
information
AWS Cloud
AWS Step Functions workflow: Store Image
Create ThumbnailStore raw Image
Store Image Information
1
2
Use-Case: Upload Image
upload image
with additional
information
AWS Cloud
AWS Step Functions workflow: Store Image
Create Thumbnail
Inform Subscribers
Store raw Image
Store Image Information
1
2
Use-Case: Upload Image
upload image
with additional
information
AWS Cloud
AWS Step Functions workflow: Store Image
Create Thumbnail
Inform Subscribers
Store raw Image
Store Image Information
1
2
Use-Case: Upload Image
upload image
with additional
information
AWS Cloud
AWS Step Functions workflow: Store Image
Create Thumbnail
Inform Subscribers
Store raw Image
Store Image Information
1
2
Use-Case: Upload Image
upload image
with additional
information
AWS Cloud
AWS Step Functions workflow: Store Image
Create Thumbnail
Inform Subscribers
Store raw Image
Store Image Information
1
2
Use-Case: Upload Image
upload image
with additional
information
AWS Cloud
AWS Step Functions workflow: Store Image
Create Thumbnail
Inform Subscribers
Store raw Image
Store Image Information
1
2
Use-Case: Upload Image
upload image
with additional
information
„Was kann
da schon
schiefgehen?“
AWS Cloud
AWS Step Functions workflow: Store Image
Create Thumbnail
Inform Subscribers
Store raw Image
Store Image Information
1
2
AWS Cloud
AWS Step Functions workflow: Store Image
Create Thumbnail
Inform Subscribers
Store raw Image
Store Image Information
1
2
AWS Cloud
AWS Step Functions workflow: Store Image
Create Thumbnail
Inform Subscribers
Store raw Image
Store Image Information
1
2
AWS Cloud
AWS Step Functions workflow: Store Image
Create Thumbnail
Inform Subscribers
Store raw Image
Store Image Information
1
2
AWS Cloud
AWS Step Functions workflow: Store Image
Create Thumbnail
Inform Subscribers
Store raw Image
Store Image Information
1
2
AWS Cloud
AWS Step Functions workflow: Store Image
Create Thumbnail
Inform Subscribers
Store raw Image
Store Image Information
1
2
AWS Cloud
AWS Step Functions workflow: Store Image
Create Thumbnail
Inform Subscribers
Store raw Image
Store Image Information
1
2
AWS Cloud
AWS Step Functions workflow: Store Image
Create Thumbnail
Inform Subscribers
Store raw Image
Store Image Information
1
2
AWS Cloud
AWS Step Functions workflow: Store Image
Create Thumbnail
Inform Subscribers
Store raw Image
Store Image Information
1
2
AWS Cloud
AWS Step Functions workflow: Store Image
Create Thumbnail
Inform Subscribers
Store raw Image
Store Image Information
1
2
Was kann da schon schiefgehen?
• Interne Programmier-/Logikfehler
• Anomalien (z.B. unerwartet/ungültige Calls)
• verlorene oder doppelte Events
• hohe Latenz / Timeouts
• Security-Attacken (z.B. DoS/DDoS)
• Personalisierte SLAs / Usage Plans
• unerwartete Workload Peaks
• …
“Run your business code
highly-available
in the cloud in response
to events and scale
without any servers to
manage.“*
*(AWS Lambda product description)
“Run your business code
highly distributed
and event driven in a non
transparent environment
with no single
point of control.“*
*(my personal interpretation)
Wie teste ich?
meine Serverless Application
Was, wann, wie und wo sollte ich testen, um …
• Vertrauen in meinen Code zu gewinnen
• das Risiko von Fehlern zu minimieren*
* vor allem in Produtktion
Testen in der traditionellen Welt
Testen in der Serverless Welt
„The biggest complexity is not within
the function itself, but in how it interacts
with other functions and services
(a.k.a. cloud components).“
Testen in der Serverless Welt
Ziele des Testens: „Risiko minimieren“
• Risiko Konfiguration
• Risiko technischer Workflow
• Risiko Businesslogik
• Risiko Integration
Testen in der Serverless Welt
Ziele des Testens: „Risiko minimieren“
• Risiko Konfiguration
• Risiko technischer Workflow
• Risiko Businesslogik
• Risiko Integration
Testen in der Serverless Welt
„Don‘t let your users
test your code!“
„Welche Art von ‚Benchmarks‘ wollen wir für unser Testing?“
• funktionale Änderungen schnell/kosteneffizient testen
• integrative Änderungen schnell/kosteneffizient testen
• integrative Änderungen so „real“ wie möglich testen
• Use-Cases und User-Stories so „real“ wie möglich testen
Testing Best Practices
#1 Trennen von Businesslogik und Infrastruktur
Testing Best Practices
AWS CloudOn-Premise
handler
logic
Kandidat für Unit Tests
e
i
u
Kandidat für Integration Tests
Kandidat für End-to-Ende Tests
u
Infrastructure Business Logic
Infrastructure Business Logic
Business Logic Tests
#2 Cloud-Infrastruktur Komponenten mocken
Testing Best Practices
AWS CloudOn-Premise
handler
logic u
um
Kandidat für Unit Tests
e
i
u
Kandidat für Integration Tests
Kandidat für End-to-Ende Tests
Infrastructure
fake infrastructure component (Context)
mock infrastructure component (Context)
#3 Lokale Umgebung für funktionale Tests verwenden (z.B. SAM local)
Testing Best Practices
AWS CloudOn-Premise
handler
logic uvia SAM local
via SAM local
SAM
yaml
TEST
u
u
Kandidat für Unit Tests
e
i
u
Kandidat für Integration Tests
Kandidat für End-to-Ende Tests
$ sam local invoke "Greetings" -e event-greeting.json --env-vars env.json
function name payload for function
$ sam local invoke "Greetings" -e event-greeting.json --env-vars env.json
function name payload for function
#4 Lokale Umgebung zum Triggern von Integration Tests verwenden
Testing Best Practices
AWS CloudOn-Premise
handler
logic uvia SAM local
via SAM local
SAM
yaml
TEST
u
u
i
i
Kandidat für Unit Tests
e
i
u
Kandidat für Integration Tests
Kandidat für End-to-Ende Tests
$ sam local start-api –p 8080
$ sam local start-api –p 8080
$ sam local start-api –p 8080
#5 Lokale Cloud-Komponenten für Integration Tests*
Testing Best Practices
AWS CloudOn-Premise
handler
logic u
via DynamoDB local
via FakeS3 via SAM local
via SAM local
SAM
yaml
TEST
u
u
i
i
i
i
WARNUNG: lokale Cloud
Komponenten können
lediglich funktionale
Korrektheit sicherstellen,
nicht aber infrastrukturelle,
wie z.B. DLQs, Timeouts,
Throttling, SLAs, …
Kandidat für Unit Tests
e
i
u
Kandidat für Integration Tests
Kandidat für End-to-Ende Tests
$ sam local generate-event [SERVICE] [OPTION]
Simulate Component Event to trigger Lambda
$ sam local genarte-event [SERVICE] [OPTION]
Simulate Component Event to trigger Lambda
Simulate Component triggered by Lambda
$ aws –endpoint-url=http://localhost:8000 dynamodb list-tables
$ java –jar DynamoDBLocal.-jar
Simulate Component triggered by Lambda
$ aws –endpoint-url=http://localhost:8000 dynamodb list-tables
Simulate Component triggered by Lambda
$ aws –endpoint-url=http://localhost:8000 dynamodb list-tables
#6 temporäre Integration-Cloud für partielle Integration Tests
Testing Best Practices
AWS CloudOn-Premise
handler
logic uvia SAM local
via SAM local
SAM
yaml
TEST
u
u
via DynamoDB local
via FakeS3
i
i
Temorary Intregration #Dev1
ii
INT
i
i
Kandidat für Unit Tests
e
i
u
Kandidat für Integration Tests
Kandidat für End-to-Ende Tests
#7 permanente Integration-Cloud für End-to-End Tests
Testing Best Practices
AWS CloudOn-Premise
handler
logic uvia SAM local
via SAM local
SAM
yaml
TEST
u
u
via DynamoDB local
via FakeS3
i
i
Permament IntregrationINT
e
e
e
e
i
i
Kandidat für Unit Tests
e
i
u
Kandidat für Integration Tests
Kandidat für End-to-Ende Tests
„Sind wir endlich
fertig?“
Testing endet nicht
in Produktion!
Testing in Produktion
Ziele des Testens: „Vertrauen gewinnen“
• Outages von Cloud & Cloud-Komponenten
• Outages von 3rd Party Apps
• Bugs / Probleme durch Skalierung
Testing in Produktion
Robustes Monitoring und Error Reporting
• Logging
• Tracing
• Metrics
• Alerting
Vorhersagen von Störungen
inklusive automatischer
Regenerierung!
Testing in Produktion
Chaos Engineering
• bewusst kleine “Probleme“ und „Fehler“ in
das System einstreuen!
Wie monitore ich?
meine Serverless Application
Mit einem gut geplantes Monitoring sollten wir in der Lage sein, …
• aufkommende Probleme vorherzusagen
• schnell die Ursache von Problemen zu identifizieren
• automatische Recovery-Prozesse anzustoßen
• notwendige Alarme zu triggern
Real-Life Monitoring
Real-Life Monitoring
Business
KPI
UX
SLA
“Produkte
pro Bestellung”
“Durchschnittlicher
Bestellwert”
“Abbruchrate”
“Erste Darstellung
von Inhalten”
“Erste sinnvolle
Darstellung"
“Erste
Interaktion”
“Verfügbarkeit”
“Latenz”
“Beständigkeit”
“Konsistenz”
Gut geplantes Monitoring berücksichtigt verschiedene Aspekte
• reliability: Komponenten und Kommunikation
• usage: funktional und nicht-funktional
• performance: Dauer, Latenz und Timeouts
• security: Zugriffsrechte, Attacken
• costs: aktuelle Kosten, Kostenentwicklung
Real-Life Monitoring
Die 4 Säulen des Monitorings
3
2 4
1
Tracing Metrics
Alerting
Logging
3
2
Tracing Metrics
4
4
Alerting
Die 4 Säulen des Monitorings
Repräsentiert den State
einer Anwendung.
Wenn etwas schiefläuft
benötigen wir LOGs, um
herauszufinden, welche
Änderungen am State den
Fehler verursacht haben.
1
Logging
Logging
3
Metrics
4
1
Alerting
Logging
Die 4 Säulen des Monitorings
Tracing
2
Repräsentiert eine
einzelne „User‘s Journey“
durch den gesamten
Stack der Anwendung.
Tracing wird oft zur
Optimierung des Systems
genutzt.
Tracing
2
Tracing
4
1
Alerting
Logging
Die 4 Säulen des Monitorings
3
Metrics
Repräsentiert einen über
einen Zeitraum
aggregierten Messpunkt.
Hilft dabei, den aktuellen
„Health-Status“ des
Systems sowie dessen
Entwicklung festzustellen.
Metrics
3
2
Tracing Metrics
1
Logging
Die 4 Säulen des Monitorings
4
Alerting
Die Komponente des
Monitorings, die
basierende auf Metriken,
Aktionen auslöst.
Meist zur automatischen
„Selbstheilung“ verwendet
oder im zuständige
Personen zu informieren.
Alerting
Für ein gut geplantes Monitoring, sollten man daher …
• Events loggen, die eine State Transformation anstoßen
• Standard-Metriken sammeln
• Custom-Metriken definieren und sammeln
• Distributed Tracing ermöglichen
• Alarme auf individuellem und aggregierten Level definieren
Serverless Application Monitoring
Monitoring Strategie
AWS Cloud
Logging
Tracing
Metrics
Alerting
Monitoring Strategie #1: DIY
AWS Cloud
Logging
Tracing
Metrics
Alerting
Monitoring Strategie #1: DIY
AWS Cloud
universal Log
Logging
Logging
Tracing
Metrics
Alerting
Monitoring Strategie #1: DIY
AWS Cloud
universal Log
Logging
DevOps
Logging
Tracing
Metrics
Alerting
Monitoring Strategie #1: DIY
AWS Cloud
universal Log
Archive
Logging
Tracing
DevOps
Logging
Tracing
Metrics
Alerting
Monitoring Strategie #1: DIY
AWS Cloud
universal Log
Archive
Logging Metrics
Tracing
DevOps
Logging
Tracing
Metrics
Alerting
Monitoring Strategie #1: DIY
AWS Cloud
universal Log
Alarm
Archive
Logging Metrics
Tracing
Alerting
DevOps
Logging
Tracing
Metrics
Alerting
Monitoring Strategie #2: Plattform Services
AWS Cloud
Logging
Logging
Tracing
Metrics
Alerting
Monitoring Strategie #2: Plattform Services
AWS Cloud
Logging
Alerting
Metrics
“BASIC ALERTING FOR FREE”
“BASIC METRICS FOR FREE”
Logging
Tracing
Metrics
Alerting
Monitoring Strategie #2: Plattform Services
AWS Cloud
Alarm
Logging
Alerting
Metrics
Logging
Tracing
Metrics
Alerting
Monitoring Strategie #2: Plattform Services
AWS Cloud
Logging
Alerting
Metrics
Tracing (still DIY)
Alarm
Metrics
Logging
Tracing
Metrics
Alerting
Monitoring Strategie #2: Plattform Services
AWS Cloud
Alarm
Logging
Tracing
Alerting
Tracing (DIY)
Metrics
Logging
Tracing
Metrics
Alerting
Monitoring Strategie #2: Plattform Services
Logging
Tracing
Metrics
Alerting
Monitoring Strategie #2: Plattform Services
Logging
Tracing
Metrics
Alerting
Monitoring Strategie #2: Plattform Services
Logging
Tracing
Metrics
Alerting
> Monitoring
Monitoring: Lessons Learned
Was haben wir gelernt …
• ein gut durchdachtes Monitoring besteht aus 4 Säulen
• das Logging zum Festhalten von State Transformation
• das Tracing zum Verfolgen einzelner User Journeys
• die Metriken zur Feststellung des Systemzustands
• das Alerting zum (autom.) Auslösen von „heilenden“ Aktionen
„Logging data is expensive,
so better log wisely!“
„Welche Art von ‚Benchmarks‘ wollen wir für unser Monitoring?“
• Sammeln von umfangreichen System- und Anwendungsmetriken
• Metriken und Logs sollten keine User-facing Latency verursachen
• Metriken und Logs sollten in Real-Time verfügbar sein
• Metriken und Logs sollten granular und korreliert vorliegen
Monitoring Best Practices
#1 User-facing Latency vermeiden
Monitoring Best Practices
AWS Cloud
My Lambda logs
log
stream
log
data
async
sync
Log Aggregator
log
data
1
very fast and cheap
2
3
time consuming and “expensive”
parse
log stream
#2 umfangreiche System-/Anwendungsmetriken sammeln
Monitoring Best Practices
AWS Cloud
My Lambda logs
log
stream
log
data
async
sync
Log Aggregator
metrics
custom
metrics
custom
metrics
log
data
2
3
1
very fast and cheap
parse
log stream
custom
metrics
#3 unnötige Kosten vermeiden
Monitoring Best Practices
AWS Cloud
My Lambda logs
log
stream
log
data
async
sync
Log Aggregator
metrics
custom
metrics
custom
metrics
log
data
archive
logs
1
2
custom
metrics
#4 Logs und Metriken korrelieren / aggregieren
Monitoring Best Practices
AWS Cloud
My Lambda logs
log
stream
log
data
async
sync
Log Aggregator
metrics
custom
metrics
custom
metrics
log
data
archive
logs
1
correlation
ID
custom
metrics
#5 Logging via ENV Vars an Edge Server enablen/disablen
Monitoring Best Practices
AWS Cloud
My Lambda logs
log
stream
log
data
async
sync
Log Aggregator
metrics
custom
metrics
custom
metrics
log
data
archive
logs
DEBUG
on/off
ENV var
1
2
custom
metrics
#WISSENTEILEN
Fazit
Schlussfolgerung: Spaß haben mit
Serverless?
“Find suitable
serverless workload
and apply the correct
integration patterns.”
“Eat your own
serverless dog food
for monitoring
and testing“
? ? ?
Lars Röwekamp, @mobileLarson
Kontakt:
lars.roewekamp@openknowledge.de
kontakt@openknowledge.de
Besten Dank! #WISSENTEILEN
© chanchai howharn – shutterstock.com (Folie 1)
© wavebreaker – shutterstock.com (Folie 4)
© Rich Vintage – iStockphoto.com (Folie 9)
© foxaon1987 - shutterstock.com (Folie 11)
© Guide van Nipsen – wikipedia.com (Folie 19)
© Zeeker2526 - shutterstock.com (Folie 20)
© CandyDuck - shutterstock.com (Folie 80)
© Myvisual - shutterstock.com (Folie 97)
© Rawpixel.com - shutterstock.com (Folie 241)
Alle weiteren Bilder der Präsentation sind entweder von pixabay.com
oder von mir selbst erstellt.
Bildernachweis

Weitere ähnliche Inhalte

Was ist angesagt?

Das ist doch alles nur Frontend - Wer braucht da schon Architektur?
Das ist doch alles nur Frontend - Wer braucht da schon Architektur?Das ist doch alles nur Frontend - Wer braucht da schon Architektur?
Das ist doch alles nur Frontend - Wer braucht da schon Architektur?OPEN KNOWLEDGE GmbH
 
Spaß mit Microservices: Transaktionen
Spaß mit Microservices: TransaktionenSpaß mit Microservices: Transaktionen
Spaß mit Microservices: TransaktionenOPEN KNOWLEDGE GmbH
 
Aus der Rubrik "Spaß mit Microservices": Transaktionen
Aus der Rubrik "Spaß mit Microservices": TransaktionenAus der Rubrik "Spaß mit Microservices": Transaktionen
Aus der Rubrik "Spaß mit Microservices": TransaktionenOPEN KNOWLEDGE GmbH
 
Von „less Server“ bis „Serverless“: Wie viel Cloud soll es sein?
Von „less Server“ bis „Serverless“: Wie viel Cloud soll es sein?Von „less Server“ bis „Serverless“: Wie viel Cloud soll es sein?
Von „less Server“ bis „Serverless“: Wie viel Cloud soll es sein?OPEN KNOWLEDGE GmbH
 
Supersonic Java für die Cloud: Quarkus
Supersonic Java für die Cloud: QuarkusSupersonic Java für die Cloud: Quarkus
Supersonic Java für die Cloud: QuarkusOPEN KNOWLEDGE GmbH
 
Das passende Backend für meine Apps
Das passende Backend für meine AppsDas passende Backend für meine Apps
Das passende Backend für meine AppsOPEN KNOWLEDGE GmbH
 
Web-API-Design jenseits von REST und Request/Response
Web-API-Design jenseits von REST und Request/ResponseWeb-API-Design jenseits von REST und Request/Response
Web-API-Design jenseits von REST und Request/ResponseOPEN KNOWLEDGE GmbH
 
Herausforderung „Multi-Channel“-Architektur
Herausforderung „Multi-Channel“-ArchitekturHerausforderung „Multi-Channel“-Architektur
Herausforderung „Multi-Channel“-ArchitekturOPEN KNOWLEDGE GmbH
 
CQRS, der etwas andere Architekturansatz
CQRS, der etwas andere ArchitekturansatzCQRS, der etwas andere Architekturansatz
CQRS, der etwas andere ArchitekturansatzOPEN KNOWLEDGE GmbH
 
Herausforderung „Multi-Channel Architecture”
Herausforderung „Multi-Channel Architecture”Herausforderung „Multi-Channel Architecture”
Herausforderung „Multi-Channel Architecture”OPEN KNOWLEDGE GmbH
 
Amazon Lightsail Webinar
Amazon Lightsail WebinarAmazon Lightsail Webinar
Amazon Lightsail WebinarAWS Germany
 
Microservices Architecture: Architektur und Patterns
Microservices Architecture: Architektur und PatternsMicroservices Architecture: Architektur und Patterns
Microservices Architecture: Architektur und PatternsOPEN KNOWLEDGE GmbH
 
Einführung in AWS - Übersicht über die wichtigsten Services
Einführung in AWS - Übersicht über die wichtigsten Services Einführung in AWS - Übersicht über die wichtigsten Services
Einführung in AWS - Übersicht über die wichtigsten Services AWS Germany
 
Microservices Migration: Vom Monolithen zu Microservices
Microservices Migration: Vom Monolithen zu MicroservicesMicroservices Migration: Vom Monolithen zu Microservices
Microservices Migration: Vom Monolithen zu MicroservicesOPEN KNOWLEDGE GmbH
 
Zalando und AWS: Security First in der Public Cloud
Zalando und AWS: Security First in der Public Cloud Zalando und AWS: Security First in der Public Cloud
Zalando und AWS: Security First in der Public Cloud AWS Germany
 

Was ist angesagt? (20)

Das ist doch alles nur Frontend - Wer braucht da schon Architektur?
Das ist doch alles nur Frontend - Wer braucht da schon Architektur?Das ist doch alles nur Frontend - Wer braucht da schon Architektur?
Das ist doch alles nur Frontend - Wer braucht da schon Architektur?
 
Serverless: The Missing Manual
Serverless: The Missing ManualServerless: The Missing Manual
Serverless: The Missing Manual
 
Serverless Survival Guide
Serverless Survival GuideServerless Survival Guide
Serverless Survival Guide
 
Enterprise Java on Steroids
Enterprise Java on SteroidsEnterprise Java on Steroids
Enterprise Java on Steroids
 
Spaß mit Microservices: Transaktionen
Spaß mit Microservices: TransaktionenSpaß mit Microservices: Transaktionen
Spaß mit Microservices: Transaktionen
 
Aus der Rubrik "Spaß mit Microservices": Transaktionen
Aus der Rubrik "Spaß mit Microservices": TransaktionenAus der Rubrik "Spaß mit Microservices": Transaktionen
Aus der Rubrik "Spaß mit Microservices": Transaktionen
 
Von „less Server“ bis „Serverless“: Wie viel Cloud soll es sein?
Von „less Server“ bis „Serverless“: Wie viel Cloud soll es sein?Von „less Server“ bis „Serverless“: Wie viel Cloud soll es sein?
Von „less Server“ bis „Serverless“: Wie viel Cloud soll es sein?
 
Supersonic Java für die Cloud: Quarkus
Supersonic Java für die Cloud: QuarkusSupersonic Java für die Cloud: Quarkus
Supersonic Java für die Cloud: Quarkus
 
Less Server vs. Serverless?
Less Server vs. Serverless?Less Server vs. Serverless?
Less Server vs. Serverless?
 
Das passende Backend für meine Apps
Das passende Backend für meine AppsDas passende Backend für meine Apps
Das passende Backend für meine Apps
 
Web-API-Design jenseits von REST und Request/Response
Web-API-Design jenseits von REST und Request/ResponseWeb-API-Design jenseits von REST und Request/Response
Web-API-Design jenseits von REST und Request/Response
 
Herausforderung „Multi-Channel“-Architektur
Herausforderung „Multi-Channel“-ArchitekturHerausforderung „Multi-Channel“-Architektur
Herausforderung „Multi-Channel“-Architektur
 
CQRS, der etwas andere Architekturansatz
CQRS, der etwas andere ArchitekturansatzCQRS, der etwas andere Architekturansatz
CQRS, der etwas andere Architekturansatz
 
Herausforderung „Multi-Channel Architecture”
Herausforderung „Multi-Channel Architecture”Herausforderung „Multi-Channel Architecture”
Herausforderung „Multi-Channel Architecture”
 
Amazon Lightsail Webinar
Amazon Lightsail WebinarAmazon Lightsail Webinar
Amazon Lightsail Webinar
 
Microservices Architecture: Architektur und Patterns
Microservices Architecture: Architektur und PatternsMicroservices Architecture: Architektur und Patterns
Microservices Architecture: Architektur und Patterns
 
Einführung in AWS - Übersicht über die wichtigsten Services
Einführung in AWS - Übersicht über die wichtigsten Services Einführung in AWS - Übersicht über die wichtigsten Services
Einführung in AWS - Übersicht über die wichtigsten Services
 
Microservices Migration: Vom Monolithen zu Microservices
Microservices Migration: Vom Monolithen zu MicroservicesMicroservices Migration: Vom Monolithen zu Microservices
Microservices Migration: Vom Monolithen zu Microservices
 
App-Delivery-Pipeline
App-Delivery-PipelineApp-Delivery-Pipeline
App-Delivery-Pipeline
 
Zalando und AWS: Security First in der Public Cloud
Zalando und AWS: Security First in der Public Cloud Zalando und AWS: Security First in der Public Cloud
Zalando und AWS: Security First in der Public Cloud
 

Ähnlich wie Cloud Architekturen - von "less Server" zu Serverless

Blueprints bei E-Commerce Workloads mit AWS
Blueprints bei E-Commerce Workloads mit AWSBlueprints bei E-Commerce Workloads mit AWS
Blueprints bei E-Commerce Workloads mit AWSroot360 GmbH
 
Die SOA Suite in der Amazon Cloud sicher betreiben
Die SOA Suite in der Amazon Cloud sicher betreiben Die SOA Suite in der Amazon Cloud sicher betreiben
Die SOA Suite in der Amazon Cloud sicher betreiben OPITZ CONSULTING Deutschland
 
FMK2016 - Volker Krambrich - FileMaker Cloud - Amazon Web Services
FMK2016 - Volker Krambrich - FileMaker Cloud - Amazon Web ServicesFMK2016 - Volker Krambrich - FileMaker Cloud - Amazon Web Services
FMK2016 - Volker Krambrich - FileMaker Cloud - Amazon Web ServicesVerein FM Konferenz
 
Skalierung & Performance
Skalierung & PerformanceSkalierung & Performance
Skalierung & Performanceglembotzky
 
Serverless Application Framework
Serverless Application FrameworkServerless Application Framework
Serverless Application FrameworkBATbern
 
Innovationen aus der Cloud ganz einfach nutzen
Innovationen aus der Cloud ganz einfach nutzenInnovationen aus der Cloud ganz einfach nutzen
Innovationen aus der Cloud ganz einfach nutzenAmazon Web Services
 
Steinzeit war gestern! Wege der Cloud-nativen Evolution.
Steinzeit war gestern! Wege der Cloud-nativen Evolution.Steinzeit war gestern! Wege der Cloud-nativen Evolution.
Steinzeit war gestern! Wege der Cloud-nativen Evolution.QAware GmbH
 
Do´s and Dont´s mit Oracle RDS
Do´s and Dont´s mit Oracle RDS Do´s and Dont´s mit Oracle RDS
Do´s and Dont´s mit Oracle RDS esentri AG
 
Modern Lightweight Enterprise Architectures mit Java
Modern Lightweight Enterprise Architectures mit JavaModern Lightweight Enterprise Architectures mit Java
Modern Lightweight Enterprise Architectures mit JavaOPEN KNOWLEDGE GmbH
 
Cloud at massive scale and incredible speed, Ekkard Schnedermann berichtet vo...
Cloud at massive scale and incredible speed, Ekkard Schnedermann berichtet vo...Cloud at massive scale and incredible speed, Ekkard Schnedermann berichtet vo...
Cloud at massive scale and incredible speed, Ekkard Schnedermann berichtet vo...Ekkard Schnedermann
 
Steinzeit war gestern! Wege der cloud-nativen Evolution
Steinzeit war gestern! Wege der cloud-nativen EvolutionSteinzeit war gestern! Wege der cloud-nativen Evolution
Steinzeit war gestern! Wege der cloud-nativen EvolutionQAware GmbH
 
Webinar Windows auf AWS (Deutsch)
Webinar Windows auf AWS (Deutsch)Webinar Windows auf AWS (Deutsch)
Webinar Windows auf AWS (Deutsch)AWS Germany
 
skilllocation Foliensatz zu Microsoft Azure
skilllocation Foliensatz zu Microsoft Azureskilllocation Foliensatz zu Microsoft Azure
skilllocation Foliensatz zu Microsoft AzureCarola Pantenburg
 
Offline-first Architekturen: Wer bitte braucht schon Internet
Offline-first Architekturen: Wer bitte braucht schon InternetOffline-first Architekturen: Wer bitte braucht schon Internet
Offline-first Architekturen: Wer bitte braucht schon InternetOPEN KNOWLEDGE GmbH
 
Agile Softwareentwicklung mit Rails
Agile Softwareentwicklung mit RailsAgile Softwareentwicklung mit Rails
Agile Softwareentwicklung mit RailsHussein Morsy
 
Steinzeit war gestern! Wege der Cloud-nativen Evolution.
Steinzeit war gestern! Wege der Cloud-nativen Evolution.Steinzeit war gestern! Wege der Cloud-nativen Evolution.
Steinzeit war gestern! Wege der Cloud-nativen Evolution.QAware GmbH
 
Webinar Neues von der re:invent 2013 Teil 1: PostgreSQL RDS, CloudTrail, neue...
Webinar Neues von der re:invent 2013 Teil 1: PostgreSQL RDS, CloudTrail, neue...Webinar Neues von der re:invent 2013 Teil 1: PostgreSQL RDS, CloudTrail, neue...
Webinar Neues von der re:invent 2013 Teil 1: PostgreSQL RDS, CloudTrail, neue...AWS Germany
 
Microsoft Azure Cloud mit der Sitecore Experience Platform
Microsoft Azure Cloud mit der Sitecore Experience PlatformMicrosoft Azure Cloud mit der Sitecore Experience Platform
Microsoft Azure Cloud mit der Sitecore Experience Platformcomspace GmbH & Co. KG
 
Where are all transactions gone? Was in_der_cloud_alles_verboten_ist
Where are all transactions gone? Was in_der_cloud_alles_verboten_istWhere are all transactions gone? Was in_der_cloud_alles_verboten_ist
Where are all transactions gone? Was in_der_cloud_alles_verboten_istRamon Anger
 

Ähnlich wie Cloud Architekturen - von "less Server" zu Serverless (20)

Blueprints bei E-Commerce Workloads mit AWS
Blueprints bei E-Commerce Workloads mit AWSBlueprints bei E-Commerce Workloads mit AWS
Blueprints bei E-Commerce Workloads mit AWS
 
Azure WorkshopPart1 Intro
Azure WorkshopPart1   IntroAzure WorkshopPart1   Intro
Azure WorkshopPart1 Intro
 
Die SOA Suite in der Amazon Cloud sicher betreiben
Die SOA Suite in der Amazon Cloud sicher betreiben Die SOA Suite in der Amazon Cloud sicher betreiben
Die SOA Suite in der Amazon Cloud sicher betreiben
 
FMK2016 - Volker Krambrich - FileMaker Cloud - Amazon Web Services
FMK2016 - Volker Krambrich - FileMaker Cloud - Amazon Web ServicesFMK2016 - Volker Krambrich - FileMaker Cloud - Amazon Web Services
FMK2016 - Volker Krambrich - FileMaker Cloud - Amazon Web Services
 
Skalierung & Performance
Skalierung & PerformanceSkalierung & Performance
Skalierung & Performance
 
Serverless Application Framework
Serverless Application FrameworkServerless Application Framework
Serverless Application Framework
 
Innovationen aus der Cloud ganz einfach nutzen
Innovationen aus der Cloud ganz einfach nutzenInnovationen aus der Cloud ganz einfach nutzen
Innovationen aus der Cloud ganz einfach nutzen
 
Steinzeit war gestern! Wege der Cloud-nativen Evolution.
Steinzeit war gestern! Wege der Cloud-nativen Evolution.Steinzeit war gestern! Wege der Cloud-nativen Evolution.
Steinzeit war gestern! Wege der Cloud-nativen Evolution.
 
Do´s and Dont´s mit Oracle RDS
Do´s and Dont´s mit Oracle RDS Do´s and Dont´s mit Oracle RDS
Do´s and Dont´s mit Oracle RDS
 
Modern Lightweight Enterprise Architectures mit Java
Modern Lightweight Enterprise Architectures mit JavaModern Lightweight Enterprise Architectures mit Java
Modern Lightweight Enterprise Architectures mit Java
 
Cloud at massive scale and incredible speed, Ekkard Schnedermann berichtet vo...
Cloud at massive scale and incredible speed, Ekkard Schnedermann berichtet vo...Cloud at massive scale and incredible speed, Ekkard Schnedermann berichtet vo...
Cloud at massive scale and incredible speed, Ekkard Schnedermann berichtet vo...
 
Steinzeit war gestern! Wege der cloud-nativen Evolution
Steinzeit war gestern! Wege der cloud-nativen EvolutionSteinzeit war gestern! Wege der cloud-nativen Evolution
Steinzeit war gestern! Wege der cloud-nativen Evolution
 
Webinar Windows auf AWS (Deutsch)
Webinar Windows auf AWS (Deutsch)Webinar Windows auf AWS (Deutsch)
Webinar Windows auf AWS (Deutsch)
 
skilllocation Foliensatz zu Microsoft Azure
skilllocation Foliensatz zu Microsoft Azureskilllocation Foliensatz zu Microsoft Azure
skilllocation Foliensatz zu Microsoft Azure
 
Offline-first Architekturen: Wer bitte braucht schon Internet
Offline-first Architekturen: Wer bitte braucht schon InternetOffline-first Architekturen: Wer bitte braucht schon Internet
Offline-first Architekturen: Wer bitte braucht schon Internet
 
Agile Softwareentwicklung mit Rails
Agile Softwareentwicklung mit RailsAgile Softwareentwicklung mit Rails
Agile Softwareentwicklung mit Rails
 
Steinzeit war gestern! Wege der Cloud-nativen Evolution.
Steinzeit war gestern! Wege der Cloud-nativen Evolution.Steinzeit war gestern! Wege der Cloud-nativen Evolution.
Steinzeit war gestern! Wege der Cloud-nativen Evolution.
 
Webinar Neues von der re:invent 2013 Teil 1: PostgreSQL RDS, CloudTrail, neue...
Webinar Neues von der re:invent 2013 Teil 1: PostgreSQL RDS, CloudTrail, neue...Webinar Neues von der re:invent 2013 Teil 1: PostgreSQL RDS, CloudTrail, neue...
Webinar Neues von der re:invent 2013 Teil 1: PostgreSQL RDS, CloudTrail, neue...
 
Microsoft Azure Cloud mit der Sitecore Experience Platform
Microsoft Azure Cloud mit der Sitecore Experience PlatformMicrosoft Azure Cloud mit der Sitecore Experience Platform
Microsoft Azure Cloud mit der Sitecore Experience Platform
 
Where are all transactions gone? Was in_der_cloud_alles_verboten_ist
Where are all transactions gone? Was in_der_cloud_alles_verboten_istWhere are all transactions gone? Was in_der_cloud_alles_verboten_ist
Where are all transactions gone? Was in_der_cloud_alles_verboten_ist
 

Mehr von OPEN KNOWLEDGE GmbH

Cloud-native and Enterprise Java? Hold my beer!
Cloud-native and Enterprise Java? Hold my beer!Cloud-native and Enterprise Java? Hold my beer!
Cloud-native and Enterprise Java? Hold my beer!OPEN KNOWLEDGE GmbH
 
From Zero to still Zero: The most beautiful mistakes going into the cloud.
From Zero to still Zero: The most beautiful mistakes going into the cloud. From Zero to still Zero: The most beautiful mistakes going into the cloud.
From Zero to still Zero: The most beautiful mistakes going into the cloud. OPEN KNOWLEDGE GmbH
 
Ready for the Future: Jakarta EE in Zeiten von Cloud Native & Co
Ready for the Future: Jakarta EE in Zeiten von Cloud Native & CoReady for the Future: Jakarta EE in Zeiten von Cloud Native & Co
Ready for the Future: Jakarta EE in Zeiten von Cloud Native & CoOPEN KNOWLEDGE GmbH
 
Shared Data in verteilten Architekturen
Shared Data in verteilten ArchitekturenShared Data in verteilten Architekturen
Shared Data in verteilten ArchitekturenOPEN KNOWLEDGE GmbH
 
Machine Learning mit TensorFlow.js
Machine Learning mit TensorFlow.jsMachine Learning mit TensorFlow.js
Machine Learning mit TensorFlow.jsOPEN KNOWLEDGE GmbH
 
It's not Rocket Science: Neuronale Netze
It's not Rocket Science: Neuronale NetzeIt's not Rocket Science: Neuronale Netze
It's not Rocket Science: Neuronale NetzeOPEN KNOWLEDGE GmbH
 
API-Design, Microarchitecture und Testing
API-Design, Microarchitecture und TestingAPI-Design, Microarchitecture und Testing
API-Design, Microarchitecture und TestingOPEN KNOWLEDGE GmbH
 
Das Product Goal oder "Ohne Ziele laufen eben alle in die Richtung, die ihnen...
Das Product Goal oder "Ohne Ziele laufen eben alle in die Richtung, die ihnen...Das Product Goal oder "Ohne Ziele laufen eben alle in die Richtung, die ihnen...
Das Product Goal oder "Ohne Ziele laufen eben alle in die Richtung, die ihnen...OPEN KNOWLEDGE GmbH
 
Maschinen ohne Gewissen: wenn KI auf Ethik trifft
Maschinen ohne Gewissen: wenn KI auf Ethik trifftMaschinen ohne Gewissen: wenn KI auf Ethik trifft
Maschinen ohne Gewissen: wenn KI auf Ethik trifftOPEN KNOWLEDGE GmbH
 
Modern Web: Trends der Webentwicklung
Modern Web: Trends der WebentwicklungModern Web: Trends der Webentwicklung
Modern Web: Trends der WebentwicklungOPEN KNOWLEDGE GmbH
 
Technische Gründe für schlechte Entwicklungsperformance
Technische Gründe für schlechte EntwicklungsperformanceTechnische Gründe für schlechte Entwicklungsperformance
Technische Gründe für schlechte EntwicklungsperformanceOPEN KNOWLEDGE GmbH
 
Von „less Server" zu Serverless: eine Reise durch die Cloud
Von „less Server" zu Serverless: eine Reise durch die CloudVon „less Server" zu Serverless: eine Reise durch die Cloud
Von „less Server" zu Serverless: eine Reise durch die CloudOPEN KNOWLEDGE GmbH
 

Mehr von OPEN KNOWLEDGE GmbH (18)

Nie wieder Log-Files!
Nie wieder Log-Files!Nie wieder Log-Files!
Nie wieder Log-Files!
 
Cloud-native and Enterprise Java? Hold my beer!
Cloud-native and Enterprise Java? Hold my beer!Cloud-native and Enterprise Java? Hold my beer!
Cloud-native and Enterprise Java? Hold my beer!
 
From Zero to still Zero: The most beautiful mistakes going into the cloud.
From Zero to still Zero: The most beautiful mistakes going into the cloud. From Zero to still Zero: The most beautiful mistakes going into the cloud.
From Zero to still Zero: The most beautiful mistakes going into the cloud.
 
API Expand Contract
API Expand ContractAPI Expand Contract
API Expand Contract
 
Ready for the Future: Jakarta EE in Zeiten von Cloud Native & Co
Ready for the Future: Jakarta EE in Zeiten von Cloud Native & CoReady for the Future: Jakarta EE in Zeiten von Cloud Native & Co
Ready for the Future: Jakarta EE in Zeiten von Cloud Native & Co
 
Shared Data in verteilten Architekturen
Shared Data in verteilten ArchitekturenShared Data in verteilten Architekturen
Shared Data in verteilten Architekturen
 
Machine Learning mit TensorFlow.js
Machine Learning mit TensorFlow.jsMachine Learning mit TensorFlow.js
Machine Learning mit TensorFlow.js
 
KI und Architektur
KI und ArchitekturKI und Architektur
KI und Architektur
 
It's not Rocket Science: Neuronale Netze
It's not Rocket Science: Neuronale NetzeIt's not Rocket Science: Neuronale Netze
It's not Rocket Science: Neuronale Netze
 
Business-Mehrwert durch KI
Business-Mehrwert durch KIBusiness-Mehrwert durch KI
Business-Mehrwert durch KI
 
API-Design, Microarchitecture und Testing
API-Design, Microarchitecture und TestingAPI-Design, Microarchitecture und Testing
API-Design, Microarchitecture und Testing
 
Das Product Goal oder "Ohne Ziele laufen eben alle in die Richtung, die ihnen...
Das Product Goal oder "Ohne Ziele laufen eben alle in die Richtung, die ihnen...Das Product Goal oder "Ohne Ziele laufen eben alle in die Richtung, die ihnen...
Das Product Goal oder "Ohne Ziele laufen eben alle in die Richtung, die ihnen...
 
Maschinen ohne Gewissen: wenn KI auf Ethik trifft
Maschinen ohne Gewissen: wenn KI auf Ethik trifftMaschinen ohne Gewissen: wenn KI auf Ethik trifft
Maschinen ohne Gewissen: wenn KI auf Ethik trifft
 
Modern Web: Trends der Webentwicklung
Modern Web: Trends der WebentwicklungModern Web: Trends der Webentwicklung
Modern Web: Trends der Webentwicklung
 
Technische Gründe für schlechte Entwicklungsperformance
Technische Gründe für schlechte EntwicklungsperformanceTechnische Gründe für schlechte Entwicklungsperformance
Technische Gründe für schlechte Entwicklungsperformance
 
Von „less Server" zu Serverless: eine Reise durch die Cloud
Von „less Server" zu Serverless: eine Reise durch die CloudVon „less Server" zu Serverless: eine Reise durch die Cloud
Von „less Server" zu Serverless: eine Reise durch die Cloud
 
API Design Strategy
API Design StrategyAPI Design Strategy
API Design Strategy
 
Testing APIs & Microservices
Testing APIs & MicroservicesTesting APIs & Microservices
Testing APIs & Microservices
 

Cloud Architekturen - von "less Server" zu Serverless

  • 1. #WISSENTEILEN Cloud Architekuren Von „less Server“ zu Serverless Lars Röwekamp | open knowledge GmbH @_openKnowledge | @mobileLarson
  • 2. ÜBER OPEN KNOWLEDGE Branchenneutrale Softwareentwicklung & IT-Beratung
  • 3. ÜBER MICH Wer bin ich - und wenn ja, wie viele? • CIO New Technologies • Enterprise & Mobile • Autor, Speaker, Coach & Mentor • Snowboard & MTB Enthusiast (a.k.a. “stets bemüht“) Lars Röwekamp (a.k.a. @mobileLarson)
  • 5. Mein Server und ich ... „The Nightmare“
  • 6. #WISSENTEILEN Server Q&A„Dinge, über die ich mir Gedanken machen sollte!“
  • 7. #WISSENTEILEN #Servers: #Customer: #Traffic: #Security: Anzahl? OS? Storage? CPU? Memory? Start small! Grow fast! Die faster? Moderat, aber mit Peaks? OS? Patches? Access Control?
  • 8. “We have to be great at a number of things… operating data centers is not one of those things.”
  • 10. #WISSENTEILEN #LaborCost: #Risk: #ResourceCost: #Scaling: #LeadTime: DIY? Nein, danke! Risiko liegt zu 100% beim Provider nur zahlen, was ich nutze on-the-fly Up- und Down-Scaling neue System stehen „sofort“ zur Verfügung
  • 11. „Kein Server ist einfacher zu verwalten, als kein Server.“ (Werner Vogels, CTO Amazon) out-of-the-box self-scaling out-of-the-box self-scaling cloud-based super-backend I had a dream ...
  • 17. “We are a hospitality management organization, not an IT services company.”
  • 18. 80 Mio Gäste / 1500 EC2 „We have a 5 person operations team.”
  • 19. „Kein Server ist einfacher zu verwalten, als kein Server.“ (Werner Vogels, CTO Amazon) SERVERLESS
  • 20. The Road to less Server?
  • 21. The Road to the Cloud ... Der Serverless Showcase
  • 22. Road to less Server
  • 24. Road to less Server Self-Managed Cloud-Managed
  • 25. Road to less Server Self-Managed Cloud-Managed Provisioning Security Maintenance
  • 26. Road to less Server Self-Managed Cloud-Managed Provisioning Security Maintenance
  • 27. Road to less Server Sieht irgendwie kompliziert aus! Muss ich mich darum kümmern? Self-Managed Cloud-Managed Provisioning Security Maintenance
  • 28. Road to less Server Self-Managed Cloud-Managed Elastic Beanstalk Elastic Kubernetes Elastic Container Provisioning Security Maintenance Scaling
  • 29. Road to less Server IaaS (Infrastructure as a Service) EBS: elastic beanstalk
  • 30. Road to less Server IaaS (Infrastructure as a Service) ECS : elastic container service
  • 31. Road to less Server IaaS (Infrastructure as a Service) EKS : elastic container service for kubernetes
  • 34. Road to less Server Self-Managed Cloud-Managed Provisioning Security Maintenance Scaling
  • 35. Road to less Server Self-Managed Cloud-Managed Provisioning Security Backup/Recovery Scaling Provisioning Security Maintenance Scaling
  • 36. Road to less Server IaaS (Infrastructure as a Service)
  • 37. Road to less Server PaaS (Platform as a Service)
  • 41. “Run YOUR business code in the cloud.“
  • 44. Das klappt niemals! Warum nicht? Na, weil es DEIN Business Code ist!
  • 46. PaaS IaaS Road to less Server
  • 47. Road to less Server Self-Managed Cloud-Managed Provisioning Security Backup/Recovery Scaling Provisioning Security Maintenance Scaling
  • 48. Road to less Server Self-Managed Cloud-Managed API Key Mgmt Throtteling Zero-Downtime Region Availability Provisioning Security Backup/Recovery Scaling Provisioning Security Maintenance Scaling
  • 49. Road to less Server PaaS (Platform as a Service)
  • 50. Road to less Server PaaS (Platform as a Service)
  • 51. Road to less Server BaaS (Backend as a Service)
  • 52. Road to less Server BaaS (Backend as a Service)
  • 53. Road to less Server BaaS (Backend as a Service)
  • 54. PaaS IaaS Road to less Server ?
  • 55. PaaS IaaS Road to less Server
  • 56. #WISSENTEILEN “Run your business code highly-available in the cloud in response to events and scale without any servers to manage.“* * AWS Lambda Advertising
  • 59. #3: Build in high availability and disaster recovery
  • 61. Management: “Hmm, ich bin noch nicht überzeugt!.”
  • 62. #5: Never pay idle (Management: „Ok, I bin definitiv dabei!“)
  • 63. „Kein Server ist einfacher zu verwalten, als kein Server.“ (Werner Vogels, CTO Amazon) out-of-the-box self-scaling out-of-the-box self-scaling cloud-based super-backend Remember „your“ dreams?
  • 64. My Logic (... as a Service)
  • 65. Function (... as a Service)
  • 66. Functions als Basis für Deployment & Skalierung
  • 67. Road to less Server PaaS (Platform as a Service)
  • 68. Road to less Server FaaS (Function as a Service)
  • 70. No machines, VMs, or containers. *... are visible in the programing model
  • 71.
  • 73. AWS Lambda Microsoft Azure Functions Oracle Functions a.k.a. Project FN*** IBM Cloud Functions a.k.a Apache OpenWhisk** Google Cloud Functions Project Riff sponsored by Pivotal
  • 74.
  • 75.
  • 76. Serverless in a Nutshell
  • 77. Was ist die Idee von Serverless?
  • 78. #WISSENTEILEN Function as self-contained application Serverless Function: Entwickler schreibt eine Business- Funktion in einer der unterstützen Programmiersprachen, „bundled“ diese mit den entsprechenden Abhängigkeiten (LIBs) und lädt sie in die Cloud. Serverless Environment: Führt die Funktion bei „Aufruf“ in der passenden Runtime effizient, flexibel und hoch skalierbar aus. “
  • 79. #WISSENTEILEN Serverless no need to maintain Entwickler: Fokussiert sich ausschließlich auf die Umsetzung der Business-Logik und das Erstellen des Function-Bundle. Cloud Provider: liefert und maintained rundum-sorglos Umgebung für die Serverless Functions, inklusive etwaiger Cloud Services (z.B. Storage, DB, Streaming, AI). “
  • 81.
  • 83. AWS Cloud hello world serverless context 1 trigger request Hands-on: Hello World
  • 84. AWS Cloud hello world serverless context HelloWorld Logs 1 trigger request 2 Hands-on: Hello World
  • 85. Was passiert da unter der Haube?
  • 86. 1 trigger request Hello World „under the Hood“ AWS Cloud
  • 87. HelloWorld ZIP 1 trigger request Hello World „under the Hood“ Download Function Code ZIP Cloud Storage S3 AWS Cloud 2
  • 88. HelloWorld ZIP 1 trigger request Hello World „under the Hood“ Download Function Code Setup Runtime ZIP Cloud Storage S3 AWS Cloud 2 3
  • 89. HelloWorld ZIP 1 trigger request Hello World „under the Hood“ Download Function Code Setup Runtime Init Function ZIP Cloud Storage S3 AWS Cloud 2 3 4
  • 90. HelloWorld ZIP 1 trigger request Hello World „under the Hood“ Download Function Code Setup Runtime Init Function ZIP Cloud Storage S3 AWS Cloud 2 3 4 COLD START
  • 91. trigger request Hello World „under the Hood“ Download Function Code ZIP AWS Cloud Setup Runtime Init Function COLD START
  • 92. trigger request Hello World „under the Hood“ Download Function Code ZIP AWS Cloud Setup Runtime Init Function COLD START Execute Handler
  • 93. trigger request Hello World „under the Hood“ Download Function Code ZIP AWS Cloud Setup Runtime Init Function COLD START Execute Handler Terminate Function
  • 94. trigger request Hello World „under the Hood“ ZIP AWS Cloud COLD START Terminate Function Execute Handler
  • 95. trigger request Hello World „under the Hood“ ZIP AWS Cloud COLD START Terminate Function Execute Handler Execute Handler trigger request
  • 96. trigger request Hello World „under the Hood“ ZIP AWS Cloud COLD START Execute Handler Terminate Function Execute Handler Execute Handler trigger request trigger request
  • 99. Szenario #1: Datei-/Datenbearbeitung Datei- oder Datenbearbeitung nach Ablage im S3 Storage System • Bildbearbeitung • Thumbnail-Erzeugung • PDF-Generierung
  • 100. AWS Cloud Szenario #1: Datei-/Datenbearbeitung 1 upload image
  • 101. AWS Cloud Szenario #1: Datei-/Datenbearbeitung 1 2 upload image
  • 102. AWS Cloud Store raw Image Szenario #1: Datei-/Datenbearbeitung StoreImage Logs 1 2 3 upload image
  • 103. AWS Cloud Store raw Image Szenario #1: Datei-/Datenbearbeitung StoreImage Logs S3 Object created1 2 3 4 upload image
  • 104. AWS Cloud Store raw Image Szenario #1: Datei-/Datenbearbeitung StoreImage Logs S3 Object created1 2 3 4 upload image
  • 105. AWS Cloud Create ThumbnailStore raw Image Szenario #1: Datei-/Datenbearbeitung StoreImage Logs CreateThumbnail Logs S3 Object created1 2 3 4 5 upload image
  • 107.
  • 108. Szenario #1: Lessons Learned Was wir bisher gelernt haben … • S3 ist der Platz zur Ablage von Objekten in AWS • S3 benötigt spezielle Zugriffsrechte • S3 triggert automatisch Cloud Events an • Filter innerhalb der Lambda können S3 Event Trigger gezielt einschränken, z.B. für • Buckets • Prefix / Postfix, • IAM Nutzer / Rollen
  • 110. Szenario #2: Stream Processing Regelmäßiges abarbeiten von Streaming Data • Social Media Trendanalysen • Sensor Data Monitoring / Anomaly Detection
  • 111. AWS Cloud 1 sensor data stream is uploaded to Kinesis in real-time Szenario #2: Stream Processing tons of very important sensor data
  • 112. AWS Cloud 1 sensor data stream is uploaded to Kinesis in real-time Szenario #2: Stream Processing tons of very important sensor data
  • 113. AWS Cloud Data Stream Analysis StreamAnalyzer Logs 1 sensor data stream is uploaded to Kinesis in real-time 2 Lambda runs code to detect anomalies Szenario #2: Stream Processing tons of very important sensor data
  • 114. AWS Cloud Data Stream Analysis StreamAnalyzer Logs store anomalies extracted by lambda function 1 sensor data stream is uploaded to Kinesis in real-time 2 3 Lambda runs code to detect anomalies Szenario #2: Stream Processing tons of very important sensor data
  • 115. AWS Cloud Data Stream Analysis StreamAnalyzer Logs Real-Time Monitoring / Querying store anomalies extracted by lambda function 1 sensor data stream is uploaded to Kinesis in real-time 2 3 Lambda runs code to detect anomalies 4 data immediately available for interested parties to query Szenario #2: Stream Processing tons of very important sensor data
  • 117.
  • 118. Szenario #3: Lessons Learned Was wir bisher gelernt haben… • Kinesis erlaubt die Bearbeitung von Data / Media Stream • Kinesis benötigt spezielle Zugriffsrechte • Lambdas können Chunks eines Kinesis Streams bearbeiten • Lambdas in Verbindung mit Kinesis können genutzt werden, um … • Metriken zu erzeugen • Fehler / Anomalien zu erkennen • Media Trends zu analysieren
  • 120. Szenario #3: Web Application Serverless „all in“ einer Anwendung… • Ausliefern von statischem Content via CDN • Authentication / Autorization via BaaS • Businesslogik via FaaS (unter Verwendung von PaaS)
  • 121. Szenario #3: Web Application AWS Cloud Web Client region aware web app delivery 1
  • 122. Szenario #3: Web Application AWS Cloud Web Client region aware web app delivery 1 login via id/pwd returns JWT 2
  • 123. Szenario #3: Web Application AWS Cloud Web Client region aware web app delivery 1 login via id/pwd returns JWT 2 3 REST call
  • 124. Szenario #3: Web Application AWS Cloud Web Client region aware web app delivery 1 login via id/pwd returns JWT 2 3 REST call 4 translated lambda trigger
  • 125. Szenario #3: Web Application AWS Cloud Web Client storage related functions region aware web app delivery 1 login via id/pwd returns JWT 2 3 REST call 4 translated lambda trigger 5 lambda @work
  • 126. Szenario #3: Web Application AWS Cloud Web Client storage related functions database related functions region aware web app delivery 1 login via id/pwd returns JWT 2 3 REST call 4 translated lambda trigger 5 lambda @work 5 lambda @work
  • 127. Szenario #3: Web Application AWS Cloud Web Client storage related functions database related functions additional functions, e.g. region aware web app delivery 1 login via id/pwd returns JWT 2 6 3 REST call 4 translated lambda trigger 5 lambda @work 5 lambda @work
  • 128.
  • 129. The Road to the Cloud ... Der Serverless Showcase
  • 130. Web Image Gallery (easy version) GET ../images/{imageId} PUT ../images/{imageId} DELETE ../images/{imageId} POST ../images/
  • 131. Web Image Gallery (not so easy version) GET ../images/{imageId} PUT ../images/{imageId} DELETE ../images/{imageId} POST ../images/
  • 132. Web Image Gallery (real life version) GET ../images/{imageId} PUT ../images/{imageId} DELETE ../images/{imageId} POST ../images/
  • 133. Szenario #3: Lessons Learned Was wir bisher gelernt haben … • CloudFront und S3 zur Web App Auslieferung (statischer Content) • Cognito zur User Authentication via JWT • Ketten von async / lose gekoppelten Lambdas • Gateway dient als eine Art Function Dispatcher (plus …)
  • 134. Szenario #3: Lessons Learned Was wir bisher gelernt haben … • CloudFront und S3 zur Web App Auslieferung (statischer Content) • Cognito zur User Authentication via JWT • Ketten von async / lose gekoppelten Lambdas • Layer zur Mehrfachnutzung von Libraries in Lambdas • Gateway dient als eine Art Function Dispatcher (plus …) ?
  • 137. AWS Cloud Wofür ist ein API Gateway gut? • Security • API Key Handling • Throttling • Proxying • Logging / Tracing • Request / Respons Mapping • Staging
  • 138. AWS Cloud 1 Szenario #4: API Gateway GET ../resources/{resourceId} PUT ../resources/{resourceId} DELETE ../resources/{resourceId} POST ../resources/
  • 139. AWS Cloud Szenario #4: API Gateway 21 GET ../resources/{resourceId} PUT ../resources/{resourceId} DELETE ../resources/{resourceId} POST ../resources/
  • 140. AWS Cloud read create delete update 21 Szenario #4: API Gateway 3 GET ../resources/{resourceId} PUT ../resources/{resourceId} DELETE ../resources/{resourceId} POST ../resources/
  • 141. AWS Cloud read create delete update Szenario #4: API Gateway 56 4 GET ../resources/{resourceId} PUT ../resources/{resourceId} DELETE ../resources/{resourceId} POST ../resources/
  • 143.
  • 144. Szenario #4: Lessons Learned Was wir bisher gelernt haben ... • ein API Gateway „schützt“ die Cloud vor der Außenwelt • HTTP Requests werden in Lambda Trigger überführt • HTTP Parameter / Payload wird auf Lambda Events gemappt • Lambda Results werden in HTTP Status Codes überführt • Lambda Result Objekte werden auf HTTP Payload gemapped • API Gateways kann ein Staging-Konzpt realisieren
  • 146. The Road to the Cloud ... Der Serverless Showcase
  • 147. AWS Cloud Use-Case: Upload Image upload image with additional information
  • 148. AWS Cloud Store raw Image 1 Use-Case: Upload Image upload image with additional information
  • 149. AWS Cloud Store raw Image Store Image Information 1 2 Use-Case: Upload Image upload image with additional information
  • 150. AWS Cloud AWS Step Functions workflow: Store Image Store raw Image Store Image Information 1 2 Use-Case: Upload Image upload image with additional information
  • 151. AWS Cloud AWS Step Functions workflow: Store Image Create ThumbnailStore raw Image Store Image Information 1 2 Use-Case: Upload Image upload image with additional information
  • 152. AWS Cloud AWS Step Functions workflow: Store Image Create Thumbnail Inform Subscribers Store raw Image Store Image Information 1 2 Use-Case: Upload Image upload image with additional information
  • 153. AWS Cloud AWS Step Functions workflow: Store Image Create Thumbnail Inform Subscribers Store raw Image Store Image Information 1 2 Use-Case: Upload Image upload image with additional information
  • 154. AWS Cloud AWS Step Functions workflow: Store Image Create Thumbnail Inform Subscribers Store raw Image Store Image Information 1 2 Use-Case: Upload Image upload image with additional information
  • 155. AWS Cloud AWS Step Functions workflow: Store Image Create Thumbnail Inform Subscribers Store raw Image Store Image Information 1 2 Use-Case: Upload Image upload image with additional information
  • 156. AWS Cloud AWS Step Functions workflow: Store Image Create Thumbnail Inform Subscribers Store raw Image Store Image Information 1 2 Use-Case: Upload Image upload image with additional information
  • 158. AWS Cloud AWS Step Functions workflow: Store Image Create Thumbnail Inform Subscribers Store raw Image Store Image Information 1 2
  • 159. AWS Cloud AWS Step Functions workflow: Store Image Create Thumbnail Inform Subscribers Store raw Image Store Image Information 1 2
  • 160. AWS Cloud AWS Step Functions workflow: Store Image Create Thumbnail Inform Subscribers Store raw Image Store Image Information 1 2
  • 161. AWS Cloud AWS Step Functions workflow: Store Image Create Thumbnail Inform Subscribers Store raw Image Store Image Information 1 2
  • 162. AWS Cloud AWS Step Functions workflow: Store Image Create Thumbnail Inform Subscribers Store raw Image Store Image Information 1 2
  • 163. AWS Cloud AWS Step Functions workflow: Store Image Create Thumbnail Inform Subscribers Store raw Image Store Image Information 1 2
  • 164. AWS Cloud AWS Step Functions workflow: Store Image Create Thumbnail Inform Subscribers Store raw Image Store Image Information 1 2
  • 165. AWS Cloud AWS Step Functions workflow: Store Image Create Thumbnail Inform Subscribers Store raw Image Store Image Information 1 2
  • 166. AWS Cloud AWS Step Functions workflow: Store Image Create Thumbnail Inform Subscribers Store raw Image Store Image Information 1 2
  • 167. AWS Cloud AWS Step Functions workflow: Store Image Create Thumbnail Inform Subscribers Store raw Image Store Image Information 1 2
  • 168. Was kann da schon schiefgehen? • Interne Programmier-/Logikfehler • Anomalien (z.B. unerwartet/ungültige Calls) • verlorene oder doppelte Events • hohe Latenz / Timeouts • Security-Attacken (z.B. DoS/DDoS) • Personalisierte SLAs / Usage Plans • unerwartete Workload Peaks • …
  • 169. “Run your business code highly-available in the cloud in response to events and scale without any servers to manage.“* *(AWS Lambda product description)
  • 170. “Run your business code highly distributed and event driven in a non transparent environment with no single point of control.“* *(my personal interpretation)
  • 171.
  • 172. Wie teste ich? meine Serverless Application
  • 173. Was, wann, wie und wo sollte ich testen, um … • Vertrauen in meinen Code zu gewinnen • das Risiko von Fehlern zu minimieren* * vor allem in Produtktion
  • 174. Testen in der traditionellen Welt
  • 175. Testen in der Serverless Welt „The biggest complexity is not within the function itself, but in how it interacts with other functions and services (a.k.a. cloud components).“
  • 176. Testen in der Serverless Welt Ziele des Testens: „Risiko minimieren“ • Risiko Konfiguration • Risiko technischer Workflow • Risiko Businesslogik • Risiko Integration
  • 177. Testen in der Serverless Welt Ziele des Testens: „Risiko minimieren“ • Risiko Konfiguration • Risiko technischer Workflow • Risiko Businesslogik • Risiko Integration
  • 178. Testen in der Serverless Welt
  • 179. „Don‘t let your users test your code!“
  • 180.
  • 181. „Welche Art von ‚Benchmarks‘ wollen wir für unser Testing?“ • funktionale Änderungen schnell/kosteneffizient testen • integrative Änderungen schnell/kosteneffizient testen • integrative Änderungen so „real“ wie möglich testen • Use-Cases und User-Stories so „real“ wie möglich testen Testing Best Practices
  • 182. #1 Trennen von Businesslogik und Infrastruktur Testing Best Practices AWS CloudOn-Premise handler logic Kandidat für Unit Tests e i u Kandidat für Integration Tests Kandidat für End-to-Ende Tests u
  • 186. #2 Cloud-Infrastruktur Komponenten mocken Testing Best Practices AWS CloudOn-Premise handler logic u um Kandidat für Unit Tests e i u Kandidat für Integration Tests Kandidat für End-to-Ende Tests
  • 190. #3 Lokale Umgebung für funktionale Tests verwenden (z.B. SAM local) Testing Best Practices AWS CloudOn-Premise handler logic uvia SAM local via SAM local SAM yaml TEST u u Kandidat für Unit Tests e i u Kandidat für Integration Tests Kandidat für End-to-Ende Tests
  • 191.
  • 192. $ sam local invoke "Greetings" -e event-greeting.json --env-vars env.json function name payload for function
  • 193. $ sam local invoke "Greetings" -e event-greeting.json --env-vars env.json function name payload for function
  • 194. #4 Lokale Umgebung zum Triggern von Integration Tests verwenden Testing Best Practices AWS CloudOn-Premise handler logic uvia SAM local via SAM local SAM yaml TEST u u i i Kandidat für Unit Tests e i u Kandidat für Integration Tests Kandidat für End-to-Ende Tests
  • 195. $ sam local start-api –p 8080
  • 196. $ sam local start-api –p 8080
  • 197. $ sam local start-api –p 8080
  • 198. #5 Lokale Cloud-Komponenten für Integration Tests* Testing Best Practices AWS CloudOn-Premise handler logic u via DynamoDB local via FakeS3 via SAM local via SAM local SAM yaml TEST u u i i i i WARNUNG: lokale Cloud Komponenten können lediglich funktionale Korrektheit sicherstellen, nicht aber infrastrukturelle, wie z.B. DLQs, Timeouts, Throttling, SLAs, … Kandidat für Unit Tests e i u Kandidat für Integration Tests Kandidat für End-to-Ende Tests
  • 199. $ sam local generate-event [SERVICE] [OPTION] Simulate Component Event to trigger Lambda
  • 200. $ sam local genarte-event [SERVICE] [OPTION] Simulate Component Event to trigger Lambda
  • 201. Simulate Component triggered by Lambda $ aws –endpoint-url=http://localhost:8000 dynamodb list-tables $ java –jar DynamoDBLocal.-jar
  • 202. Simulate Component triggered by Lambda $ aws –endpoint-url=http://localhost:8000 dynamodb list-tables
  • 203. Simulate Component triggered by Lambda $ aws –endpoint-url=http://localhost:8000 dynamodb list-tables
  • 204. #6 temporäre Integration-Cloud für partielle Integration Tests Testing Best Practices AWS CloudOn-Premise handler logic uvia SAM local via SAM local SAM yaml TEST u u via DynamoDB local via FakeS3 i i Temorary Intregration #Dev1 ii INT i i Kandidat für Unit Tests e i u Kandidat für Integration Tests Kandidat für End-to-Ende Tests
  • 205. #7 permanente Integration-Cloud für End-to-End Tests Testing Best Practices AWS CloudOn-Premise handler logic uvia SAM local via SAM local SAM yaml TEST u u via DynamoDB local via FakeS3 i i Permament IntregrationINT e e e e i i Kandidat für Unit Tests e i u Kandidat für Integration Tests Kandidat für End-to-Ende Tests
  • 207.
  • 208. Testing endet nicht in Produktion!
  • 209. Testing in Produktion Ziele des Testens: „Vertrauen gewinnen“ • Outages von Cloud & Cloud-Komponenten • Outages von 3rd Party Apps • Bugs / Probleme durch Skalierung
  • 210. Testing in Produktion Robustes Monitoring und Error Reporting • Logging • Tracing • Metrics • Alerting Vorhersagen von Störungen inklusive automatischer Regenerierung!
  • 211. Testing in Produktion Chaos Engineering • bewusst kleine “Probleme“ und „Fehler“ in das System einstreuen!
  • 212. Wie monitore ich? meine Serverless Application
  • 213. Mit einem gut geplantes Monitoring sollten wir in der Lage sein, … • aufkommende Probleme vorherzusagen • schnell die Ursache von Problemen zu identifizieren • automatische Recovery-Prozesse anzustoßen • notwendige Alarme zu triggern Real-Life Monitoring
  • 214. Real-Life Monitoring Business KPI UX SLA “Produkte pro Bestellung” “Durchschnittlicher Bestellwert” “Abbruchrate” “Erste Darstellung von Inhalten” “Erste sinnvolle Darstellung" “Erste Interaktion” “Verfügbarkeit” “Latenz” “Beständigkeit” “Konsistenz”
  • 215. Gut geplantes Monitoring berücksichtigt verschiedene Aspekte • reliability: Komponenten und Kommunikation • usage: funktional und nicht-funktional • performance: Dauer, Latenz und Timeouts • security: Zugriffsrechte, Attacken • costs: aktuelle Kosten, Kostenentwicklung Real-Life Monitoring
  • 216. Die 4 Säulen des Monitorings 3 2 4 1 Tracing Metrics Alerting Logging
  • 217. 3 2 Tracing Metrics 4 4 Alerting Die 4 Säulen des Monitorings Repräsentiert den State einer Anwendung. Wenn etwas schiefläuft benötigen wir LOGs, um herauszufinden, welche Änderungen am State den Fehler verursacht haben. 1 Logging Logging
  • 218. 3 Metrics 4 1 Alerting Logging Die 4 Säulen des Monitorings Tracing 2 Repräsentiert eine einzelne „User‘s Journey“ durch den gesamten Stack der Anwendung. Tracing wird oft zur Optimierung des Systems genutzt. Tracing
  • 219. 2 Tracing 4 1 Alerting Logging Die 4 Säulen des Monitorings 3 Metrics Repräsentiert einen über einen Zeitraum aggregierten Messpunkt. Hilft dabei, den aktuellen „Health-Status“ des Systems sowie dessen Entwicklung festzustellen. Metrics
  • 220. 3 2 Tracing Metrics 1 Logging Die 4 Säulen des Monitorings 4 Alerting Die Komponente des Monitorings, die basierende auf Metriken, Aktionen auslöst. Meist zur automatischen „Selbstheilung“ verwendet oder im zuständige Personen zu informieren. Alerting
  • 221. Für ein gut geplantes Monitoring, sollten man daher … • Events loggen, die eine State Transformation anstoßen • Standard-Metriken sammeln • Custom-Metriken definieren und sammeln • Distributed Tracing ermöglichen • Alarme auf individuellem und aggregierten Level definieren Serverless Application Monitoring
  • 223. Monitoring Strategie #1: DIY AWS Cloud Logging Tracing Metrics Alerting
  • 224. Monitoring Strategie #1: DIY AWS Cloud universal Log Logging Logging Tracing Metrics Alerting
  • 225. Monitoring Strategie #1: DIY AWS Cloud universal Log Logging DevOps Logging Tracing Metrics Alerting
  • 226. Monitoring Strategie #1: DIY AWS Cloud universal Log Archive Logging Tracing DevOps Logging Tracing Metrics Alerting
  • 227. Monitoring Strategie #1: DIY AWS Cloud universal Log Archive Logging Metrics Tracing DevOps Logging Tracing Metrics Alerting
  • 228. Monitoring Strategie #1: DIY AWS Cloud universal Log Alarm Archive Logging Metrics Tracing Alerting DevOps Logging Tracing Metrics Alerting
  • 229. Monitoring Strategie #2: Plattform Services AWS Cloud Logging Logging Tracing Metrics Alerting
  • 230. Monitoring Strategie #2: Plattform Services AWS Cloud Logging Alerting Metrics “BASIC ALERTING FOR FREE” “BASIC METRICS FOR FREE” Logging Tracing Metrics Alerting
  • 231. Monitoring Strategie #2: Plattform Services AWS Cloud Alarm Logging Alerting Metrics Logging Tracing Metrics Alerting
  • 232. Monitoring Strategie #2: Plattform Services AWS Cloud Logging Alerting Metrics Tracing (still DIY) Alarm Metrics Logging Tracing Metrics Alerting
  • 233. Monitoring Strategie #2: Plattform Services AWS Cloud Alarm Logging Tracing Alerting Tracing (DIY) Metrics Logging Tracing Metrics Alerting
  • 234. Monitoring Strategie #2: Plattform Services Logging Tracing Metrics Alerting
  • 235. Monitoring Strategie #2: Plattform Services Logging Tracing Metrics Alerting
  • 236. Monitoring Strategie #2: Plattform Services Logging Tracing Metrics Alerting
  • 238.
  • 239. Monitoring: Lessons Learned Was haben wir gelernt … • ein gut durchdachtes Monitoring besteht aus 4 Säulen • das Logging zum Festhalten von State Transformation • das Tracing zum Verfolgen einzelner User Journeys • die Metriken zur Feststellung des Systemzustands • das Alerting zum (autom.) Auslösen von „heilenden“ Aktionen
  • 240. „Logging data is expensive, so better log wisely!“
  • 241.
  • 242. „Welche Art von ‚Benchmarks‘ wollen wir für unser Monitoring?“ • Sammeln von umfangreichen System- und Anwendungsmetriken • Metriken und Logs sollten keine User-facing Latency verursachen • Metriken und Logs sollten in Real-Time verfügbar sein • Metriken und Logs sollten granular und korreliert vorliegen Monitoring Best Practices
  • 243. #1 User-facing Latency vermeiden Monitoring Best Practices AWS Cloud My Lambda logs log stream log data async sync Log Aggregator log data 1 very fast and cheap 2 3 time consuming and “expensive” parse log stream
  • 244. #2 umfangreiche System-/Anwendungsmetriken sammeln Monitoring Best Practices AWS Cloud My Lambda logs log stream log data async sync Log Aggregator metrics custom metrics custom metrics log data 2 3 1 very fast and cheap parse log stream custom metrics
  • 245. #3 unnötige Kosten vermeiden Monitoring Best Practices AWS Cloud My Lambda logs log stream log data async sync Log Aggregator metrics custom metrics custom metrics log data archive logs 1 2 custom metrics
  • 246. #4 Logs und Metriken korrelieren / aggregieren Monitoring Best Practices AWS Cloud My Lambda logs log stream log data async sync Log Aggregator metrics custom metrics custom metrics log data archive logs 1 correlation ID custom metrics
  • 247. #5 Logging via ENV Vars an Edge Server enablen/disablen Monitoring Best Practices AWS Cloud My Lambda logs log stream log data async sync Log Aggregator metrics custom metrics custom metrics log data archive logs DEBUG on/off ENV var 1 2 custom metrics
  • 249. Schlussfolgerung: Spaß haben mit Serverless?
  • 250. “Find suitable serverless workload and apply the correct integration patterns.”
  • 251. “Eat your own serverless dog food for monitoring and testing“
  • 252.
  • 253. ? ? ?
  • 255. © chanchai howharn – shutterstock.com (Folie 1) © wavebreaker – shutterstock.com (Folie 4) © Rich Vintage – iStockphoto.com (Folie 9) © foxaon1987 - shutterstock.com (Folie 11) © Guide van Nipsen – wikipedia.com (Folie 19) © Zeeker2526 - shutterstock.com (Folie 20) © CandyDuck - shutterstock.com (Folie 80) © Myvisual - shutterstock.com (Folie 97) © Rawpixel.com - shutterstock.com (Folie 241) Alle weiteren Bilder der Präsentation sind entweder von pixabay.com oder von mir selbst erstellt. Bildernachweis