SERVERLESS CHALLENGES
İBRAHİM GÜRSES
WHO AM I?
▸ Graduated From Bilkent University CS in 2011 in Ankara
▸ Software Engineer @Thundra
▸ 8 years of coding experience mostly in Java Enterprise
Applications
▸ Co-Founder of Ankara Cloud Meetup
▸ AWS Certified Developer Associate
AGENDA
▸ Serverless Introduction
▸ AWS Lambda and popular server less architecture
▸ My Story with AWS Lambda
▸ Development Story of Thundra
▸ Thundra Demo
SERVERLESS
https://www.youtube.com/watch?v=aXaZAFi3Ytk
SERVERLESS
WHAT IS SERVERLESS?
BaaS (Backend-as-a-Service)
WHAT IS SERVERLESS?
FaaS (Function as a Service)
Host
Instance
Application
Process
OPERATION
OPERATION
OPERATION
FaaS Platform
OPERATION
COMMON TRAITS OF SERVERLESS FRAMEWORK
#1
RESTFUL
INTERFACES
#2
EVENT
DRIVEN
#3
POLYGLOT
SERVICES
#4
STATELESS
#5
NARROWLY
FOCUSED
#6
SHORT
RUNNING
FAAS TRIGERING EVENTS
▸ Message Bus
▸ Network File Systems
▸ Time Event
▸ Http Endpoint
COMMON TRAITS OF SERVERLESS FRAMEWORK
▸ No management of server hosts of server processes
▸ Self auto-scale and auto provision on loads
▸ Cost are based on precise usage (0 usage = 0 cost)
▸ Performance capabilities defined in terms other than host
size/count
▸ Implicit High Availability
BENEFITS
▸ Reduced Labor Cost
▸ Reduced Risk
▸ Reduced Infra Cost
▸ Increased scaling flexibility
▸ Shorter load time
PROBLEMS
▸ Loss of Control
▸ Loss of Server Optimization
▸ DoS Yourself
▸ Vendor lock-in (Maybe not)
▸ Tooling
▸ Testing(Embrace the cloud)
▸ Latency
▸ State? What State?
▸ Managed Services are moving targets
LAMBDA OS UPDATE
STILL NEED GREAT ENGINEERS
▸ Everything is Event Driven
▸ Functions should be
idempotent
▸ Stateless with a twist
▸ Choose additional tools
wisely
USE CASE & NOT SO GREAT
▸ Latency tolerant, async app
▸ Latency tolerant, sync app
NOT SO GREAT
USE CASE
▸ Low Latency & sync app (<10ms)
▸ Large scale and stateful
SERVERLESS IS MORE SECURE
▸ No Unpatched Servers
▸ No Snowflake Servers
▸ No SSH
▸ Every request is authorized and audible
▸ Functions are short-lived
MOTIVATION BEHIND SERVERLESS
https://medium.com/netflix-techblog/the-netflix-dynamic-scripting-platform-78c1b18b2a74
SERVERLESS MANIFESTO
▸ Functions are the unit of deployment and
scaling
▸ No machines, VMs or containers visible in the
programming model
▸ Permanent storage lives elsewhere
▸ Scales per request;
▸ Never pay for idle
▸ Implicitly fault-tolerant because functions can
run anywhere
▸ BYOC : Bring your own code
▸ Metrics, logging and traces are a universal right
http://alexander.holbreich.org/serverless-manifesto/
OBSERVABILITY
▸ Metrics
▸ Logs
▸ Traces
In control theory, observability is a measure of how well internal states of a system
can be inferred from knowledge of its external outputs. The observability and
controllability of a system are mathematical duals.
THREE PILLARS OF OBSERVABILITY
EVOLUTION OF CLOUD COMPUTING
SERVERLESS IS NOT PAAS
https://twitter.com/adrianco/status/736553530689998848
SHARED RESPONSIBILITY MODEL
AWS LAMBDA PROGRAMMING MODEL
▸ Handler
▸ The context object
▸ Logging
▸ Exception
▸ Events
▸ Resources
AWS LAMBDA PROGRAMMING MODEL
AWS LAMBDA PROGRAMMING MODEL
https://gist.github.com/kobalski/
e7115a01c924f03e6ee29cd3a62c5059
AWS LAMBDA LIMITS
PATTERN 1: WEB APP/ MICROSERVICES/API
PATTERN 2: FILE PROCESSING PIPELINE
Drawn with: https://cloudcraft.co/
HOLY GRAIL OF SOFTWARE DEVELOPMENT
J2EE 3 LAYERED ARCHITECTURE
https://twitter.com/funcOfJoe/status/1110754437834764288
TECHNICAL LIMITATIONS 3 YEARS AGO
▸ 5 minute execution limit
▸ Limited Language Runtime
▸ No SQS Event Trigger
▸ No Websockets
▸ No Serverless Databases
▸ No Libraries Code Sharing
▸ Limited vendor ecosystem
FRAMEWORKS FOR BUILDING SERVERLESS APPS
DEPLOYMENT
SERVERLEESS CRUD
Drawn with: https://cloudcraft.co/
OUR ARCHITECTURE
SERVERLESS MONOLITH
https://twitter.com/kelseyhightower/status/1117452467216601088
DON’T !!!
LEARN FROM FAILURES
▸ Wrote my first infinite recursive function, Big AWS Bill
▸ Run Lambda Inside VPC and deal with cold start
▸ See lambda might invoke twice in async invocation
▸ No concurrent execution limit. One lambda exhausted whole
system
▸ Run Lambda Inside VPC, ENI Exhaustion whole system down again
▸ Got my first out of memory error and time out error and not alerted
correctly
▸ Infinite retry with a kinesis shard, Big AWS Bill
https://cloudonaut.io/your-lambda-function-might-execute-twice-deal-with-it/
https://read.acloud.guru/does-aws-lambda-keep-its-serverless-marketing-promise-of-continuous-scaling-e990114bb379
$40.000 INCIDENT
NO OPS IS A DREAM IN SERVERLESS
https://twitter.com/berkay/status/925542116662620160
SERVERLESS SURVEY
https://serverless.com/blog/2018-serverless-
community-survey-huge-growth-usage/
EMBRACE THE MANAGED SERVICES
https://twitter.com/ShortJared/status/1100887501047132160
EMBRACE THE MANAGED SERVICES
Accept the discomfort of not owning your your own destiny.
Ben Kehoe
EMBRACE THE MANAGED SERVICES
WHAT IS THUNDRA?
The black box nature of AWS Lambda and other serverless environments means
that identifying and fixing performance issues is difficult and time-consuming.
Built for straightforward debugging, monitoring, and observability, Thundra
provides deep insight into your entire serverless environment. Starting from bird
eye view of your serverless architecture to the tiniest detail, Thundra collects and
correlates all your metrics, logs, and traces, allowing you to quickly identify
problematic invocations and also analyzes external services associated with that
function.
With Thundra’s zero overhead and automated instrumentation capabilities, your
developers are free to write code without worrying about bulking up their
Lambdas or wasting time on chasing black box problems.
WHAT IS THUNDRA?
From bird eye-view
To the tiniest details
PRODUCT OVERVIEW
▸ Flexible Instrumentation
▸ Zero Overhead
▸ Detailed Tracing
▸ Custom Querying
▸ Warm-Up
▸ Metric, trace log aggregation
▸ Debugging
▸ Chaos Engineering
▸ Architectural Overview
ZERO OVERHEAD
DEMO
QUESTIONS?

Stockholm Serverless Meetup - Serverless Challenges

  • 1.
  • 2.
    WHO AM I? ▸Graduated From Bilkent University CS in 2011 in Ankara ▸ Software Engineer @Thundra ▸ 8 years of coding experience mostly in Java Enterprise Applications ▸ Co-Founder of Ankara Cloud Meetup ▸ AWS Certified Developer Associate
  • 3.
    AGENDA ▸ Serverless Introduction ▸AWS Lambda and popular server less architecture ▸ My Story with AWS Lambda ▸ Development Story of Thundra ▸ Thundra Demo
  • 4.
  • 5.
  • 6.
    WHAT IS SERVERLESS? BaaS(Backend-as-a-Service)
  • 7.
    WHAT IS SERVERLESS? FaaS(Function as a Service) Host Instance Application Process OPERATION OPERATION OPERATION FaaS Platform OPERATION
  • 8.
    COMMON TRAITS OFSERVERLESS FRAMEWORK #1 RESTFUL INTERFACES #2 EVENT DRIVEN #3 POLYGLOT SERVICES #4 STATELESS #5 NARROWLY FOCUSED #6 SHORT RUNNING
  • 9.
    FAAS TRIGERING EVENTS ▸Message Bus ▸ Network File Systems ▸ Time Event ▸ Http Endpoint
  • 10.
    COMMON TRAITS OFSERVERLESS FRAMEWORK ▸ No management of server hosts of server processes ▸ Self auto-scale and auto provision on loads ▸ Cost are based on precise usage (0 usage = 0 cost) ▸ Performance capabilities defined in terms other than host size/count ▸ Implicit High Availability
  • 11.
    BENEFITS ▸ Reduced LaborCost ▸ Reduced Risk ▸ Reduced Infra Cost ▸ Increased scaling flexibility ▸ Shorter load time
  • 12.
    PROBLEMS ▸ Loss ofControl ▸ Loss of Server Optimization ▸ DoS Yourself ▸ Vendor lock-in (Maybe not) ▸ Tooling ▸ Testing(Embrace the cloud) ▸ Latency ▸ State? What State? ▸ Managed Services are moving targets
  • 13.
  • 14.
    STILL NEED GREATENGINEERS ▸ Everything is Event Driven ▸ Functions should be idempotent ▸ Stateless with a twist ▸ Choose additional tools wisely
  • 15.
    USE CASE &NOT SO GREAT ▸ Latency tolerant, async app ▸ Latency tolerant, sync app NOT SO GREAT USE CASE ▸ Low Latency & sync app (<10ms) ▸ Large scale and stateful
  • 16.
    SERVERLESS IS MORESECURE ▸ No Unpatched Servers ▸ No Snowflake Servers ▸ No SSH ▸ Every request is authorized and audible ▸ Functions are short-lived
  • 17.
  • 18.
    SERVERLESS MANIFESTO ▸ Functionsare the unit of deployment and scaling ▸ No machines, VMs or containers visible in the programming model ▸ Permanent storage lives elsewhere ▸ Scales per request; ▸ Never pay for idle ▸ Implicitly fault-tolerant because functions can run anywhere ▸ BYOC : Bring your own code ▸ Metrics, logging and traces are a universal right http://alexander.holbreich.org/serverless-manifesto/
  • 19.
    OBSERVABILITY ▸ Metrics ▸ Logs ▸Traces In control theory, observability is a measure of how well internal states of a system can be inferred from knowledge of its external outputs. The observability and controllability of a system are mathematical duals. THREE PILLARS OF OBSERVABILITY
  • 20.
  • 21.
    SERVERLESS IS NOTPAAS https://twitter.com/adrianco/status/736553530689998848
  • 22.
  • 23.
    AWS LAMBDA PROGRAMMINGMODEL ▸ Handler ▸ The context object ▸ Logging ▸ Exception ▸ Events ▸ Resources
  • 24.
  • 25.
    AWS LAMBDA PROGRAMMINGMODEL https://gist.github.com/kobalski/ e7115a01c924f03e6ee29cd3a62c5059
  • 26.
  • 27.
    PATTERN 1: WEBAPP/ MICROSERVICES/API
  • 28.
    PATTERN 2: FILEPROCESSING PIPELINE Drawn with: https://cloudcraft.co/
  • 29.
    HOLY GRAIL OFSOFTWARE DEVELOPMENT
  • 30.
    J2EE 3 LAYEREDARCHITECTURE https://twitter.com/funcOfJoe/status/1110754437834764288
  • 31.
    TECHNICAL LIMITATIONS 3YEARS AGO ▸ 5 minute execution limit ▸ Limited Language Runtime ▸ No SQS Event Trigger ▸ No Websockets ▸ No Serverless Databases ▸ No Libraries Code Sharing ▸ Limited vendor ecosystem
  • 32.
    FRAMEWORKS FOR BUILDINGSERVERLESS APPS
  • 33.
  • 34.
    SERVERLEESS CRUD Drawn with:https://cloudcraft.co/
  • 35.
  • 36.
  • 37.
  • 38.
    LEARN FROM FAILURES ▸Wrote my first infinite recursive function, Big AWS Bill ▸ Run Lambda Inside VPC and deal with cold start ▸ See lambda might invoke twice in async invocation ▸ No concurrent execution limit. One lambda exhausted whole system ▸ Run Lambda Inside VPC, ENI Exhaustion whole system down again ▸ Got my first out of memory error and time out error and not alerted correctly ▸ Infinite retry with a kinesis shard, Big AWS Bill https://cloudonaut.io/your-lambda-function-might-execute-twice-deal-with-it/ https://read.acloud.guru/does-aws-lambda-keep-its-serverless-marketing-promise-of-continuous-scaling-e990114bb379
  • 39.
  • 40.
    NO OPS ISA DREAM IN SERVERLESS https://twitter.com/berkay/status/925542116662620160
  • 41.
  • 42.
    EMBRACE THE MANAGEDSERVICES https://twitter.com/ShortJared/status/1100887501047132160
  • 43.
    EMBRACE THE MANAGEDSERVICES Accept the discomfort of not owning your your own destiny. Ben Kehoe
  • 44.
  • 45.
    WHAT IS THUNDRA? Theblack box nature of AWS Lambda and other serverless environments means that identifying and fixing performance issues is difficult and time-consuming. Built for straightforward debugging, monitoring, and observability, Thundra provides deep insight into your entire serverless environment. Starting from bird eye view of your serverless architecture to the tiniest detail, Thundra collects and correlates all your metrics, logs, and traces, allowing you to quickly identify problematic invocations and also analyzes external services associated with that function. With Thundra’s zero overhead and automated instrumentation capabilities, your developers are free to write code without worrying about bulking up their Lambdas or wasting time on chasing black box problems.
  • 46.
    WHAT IS THUNDRA? Frombird eye-view To the tiniest details
  • 47.
    PRODUCT OVERVIEW ▸ FlexibleInstrumentation ▸ Zero Overhead ▸ Detailed Tracing ▸ Custom Querying ▸ Warm-Up ▸ Metric, trace log aggregation ▸ Debugging ▸ Chaos Engineering ▸ Architectural Overview
  • 48.
  • 49.
  • 50.