Serverless Computing

Someone Else's Servers

Tusa Viktor @ Xively

@talien

github.com/talien

Computational Unit

  • Different aspects
    • Business: What you pay for
      • Unit: $
    • Developer: What your program use
      • Unit: CPU/Memory/Time
    • Ops: What you manage
      • Number of servers/databases/log lines/metrics

History

  • Mainframes
    • Time-shared usage
    • Not easy to extend capacity
  • PCs/Data Centers
    • Roles are separated on different servers
    • Monolith applications
    • Easier to extend capacity
  • Virtualization/Containerization
    • Fine-grained capacity on different apps
    • Still need to know the whole capacity
  • Public Cloud/IaaS/PaaS
    • "Capacity is not my problem anymore"
    • Computational unit is still one container/server

Responsibilities

  • Hardware management
    • Data Center (on-premise)
  • OS management, patch management
    • IaaS
  • App management
    • PaaS

Serverless

  • New computational model
  • Computational unit is 1 function call (Function-as-a-Service)
  • If no function call happens, nothing to pay for
  • Other category: Backend-as-a-Service, DB-as-a-Service

Function-as-a-Service

  • Event driven architecture
  • Triggers + Functions
    • Messages, Schedules, State changes
  • Billing unit: GB-seconds
  • Constraints:
    • memory
    • execution time (5 min in Lambda)
    • parallelization
  • Stateless

Backend-as-a-Service

  • Common aspects of application
    • Authentication, Authorization, User tracking
    • eg: Auth0, Firebase
  • Heavily used in Mobile development
  • API driven
  • Easy to integrate

Serverless Systems

  • AWS Lambda
    • First amongst public clouds
    • Nicely integrates with other part of AWS
  • Azure Functions
    • Very similar to AWS Lambda
    • Two "Consumption Plans"
  • Google Cloud Functions
    • Still in Beta
  • OpenWhisk/IBM Bluemix
    • Open source
  • Over kubernetes serverless:
    • Funktion, Kubeless, Fission

Serverless Architectures

  • Event-driven, "nanoservices"
  • Supports popular runtimes
    • Java, NodeJs, Python, C#
  • IoT is main target
  • Events, Triggers
    • HTTP triggers
      • eg.: AWS API Gateway
    • Pub/Sub triggers
    • Message queue triggers
    • State changes
      • Uploaded file to blob storage
    • Scheduled events ("cloud cron")

Serverless Cons

  • Not easy to estimate costs upfront
  • Can be expensive
    • 3mill req, each 1 sec, 512 MB memory
    • AWS: 15$, Azure: 20$
    • smallest instance: 5$/month both in Azure/AWS
  • "Cold start"
    • First call after idle time is slow
  • Function initialization is not deterministic

Serverless Cons #2

  • Patching is not in our hand (fixed runtimes)
  • No service discovery
  • Cannot attach debugger
    • More logging needed
  • Hard to test locally
    • AWS SAM Local
    • Azure Functions Runtime

Serverless Framework

 

  • Formerly JAWS,
  • First framework to utilize AWS Lambda/API GW
  • CLI written in node
  • Support major serverless platforms
    • AWS
    • Azure
    • Google Cloud
    • OpenWhisk

Bottom Line

  • Lot of Cons, but what are the pros?
  • Very easy to deploy
  • Ideal for prototyping
  • No need for classic ops (patch management, software install & config, ssh, etc).
  • Free tier can handle small websites
  • Use cases:
    • Event driven architecture 
    • IoT
    • Automation

The End!

Thank you!

Serverless computing

By Tusa Viktor

Serverless computing

  • 1,356