Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Fifty shades of Serverless


Published on

Serverless is the new black, right? And yet there are so many nuances - different vendors and different ways of making use of serverless. In this talk we look at the options available to developers in general and Java developers in particular. We also look at some caveats to consider before going serverless.

Published in: Software
  • Be the first to comment

  • Be the first to like this

Fifty shades of Serverless

  1. 1. Copyright©SolidBeansAB Mattias Jiderhamn Fifty shades of Serverless
  2. 2. Copyright©SolidBeansAB Mattias Jiderhamn Speaker me = new Speaker(”Mattias Jiderhamn”); me.setEmployer(”Solid Beans”); me.setJavaEnthusiast(true); me.addAchievemnt(Achievement.JavaOneRockStar); me.setTwitterHandle(”@mjiderhamn”) me.setBlog(””)
  3. 3. Copyright©SolidBeansAB it’s just someone else’s computer There is no Cloud
  4. 4. Copyright©SolidBeansAB it’s just someone else’s server There is no Serverless
  5. 5. Copyright©SolidBeansAB Serverless = Function as a Service = FaaS
  6. 6. Copyright©SolidBeansAB Mattias Jiderhamn Monolith Microservices Serverless
  7. 7. Copyright©SolidBeansAB Mattias Jiderhamn Monolith Microservices FaaS Monolith Function Microservice Microservice Microservice Function Function Function Function Function
  8. 8. Copyright©SolidBeansAB Serverless offerings
  9. 9. Copyright©SolidBeansAB Mattias Jiderhamn AWS Lambda Azure Functions Google Cloud Functions Supported languages /runtime Java Node.js C# Python (Go, Rust via Apex) Java (preview) Node.js, TypeScript C#, F# Python PHP Batch, Bash, PowerShell Node.js Python Offering Cloud Cloud (Consumption vs Dedicated) On Premise (Azure Stack) Cloud Free tier (per month) 1 M requests 400 k GB-s 1 M requests 400 k GB-s 2 M requests 400 k GB-s, 200 k GHz-s 5GB traffic Pricing (August 2018, Europe) $0.20 / 1M requests $0.00001667 / GB-s $0.20 / 1M requests $0.000016 / GB-s $0.40 / 1M requests $0.0000025 / GB-s $0.00001 / GHz-s $0.12 per GB traffic The Big Three
  10. 10. Copyright©SolidBeansAB Mattias Jiderhamn IBM Cloud Functions Webtask Spotinst Functions Supported languages /runtime Docker Java Node.js Swift Go Scala Python, PHP, Ruby Bash Node.js Python Ruby Perl Php Lua, Babel, Coffee, Scheme, Smalltalk, Tcl Node.js C# T-SQL Java Go Node.js Ruby Python Node.js Offering Cloud On Premise (OpenWhisk) Cloud Cloud Multi cloud Free tier (per month) 400 k GB-s 1 k requests 1 request/s 3 services 64 MB/service Pricing (August 2018) $0.000017 / GB-s $10/25/50/200 / mth Spot pricing $5/30/150 / mth The Challengers
  11. 11. Copyright©SolidBeansAB Mattias Jiderhamn OpenWhisk Runs on Docker Kubernetes Cloud (IBM) Docker Libraries for Java Go Ruby Python PHP Node.js Java Node.js Python Shell Java Node.js Swift Go Scala Python PHP Ruby License Apache 2.0 Apache 2.0 Apache 2.0 The Open Source
  12. 12. Copyright©SolidBeansAB Mattias Jiderhamn Runs on Kubernetes Kubernetes Docker Swarm Kubernetes Docker Libraries for Node.js .NET Python Ruby PHP Go Ballerina Java C# Node.js Go Python Ruby C# Node.js Python Go PHP Go Node.js Ruby License Apache 2.0 MIT Apache 2.0 Apache 2.0 The Open Source
  13. 13. Copyright©SolidBeansAB it’s just someone else’s server There is no Serverless
  14. 14. Copyright©SolidBeansAB Serverless-ishServerless
  15. 15. Copyright©SolidBeansAB DEMO
  16. 16. Copyright©SolidBeansAB Mattias Jiderhamn HTTP API Gateway HTTP Web hooks (GitHub, Slack) HTTP Blob store S3 Blob storage Cloud Storage DB DynamoDB Cosmos DB Table storage Firebase Messages SQS Queue storage Service Bus Event Grid Cloud Pub/Sub Stream Kinesis Event Hub Notifications SNS Notification Hub Cron CloudWatch Events Timer Event sources / Triggers
  17. 17. Copyright©SolidBeansAB Mattias Jiderhamn AWS Lamda event sources • E-mail (Simple Email Service) • Log (CloudWatch Log) • Provisioning (CloudFormation) • Infra events (CloudWatch Events) • Git push (CodeCommit) • Voice (Alexa) • Conversation (Lex) • Hardware (IoT Button) • ...
  18. 18. Copyright©SolidBeansAB Mattias Jiderhamn Azure Functions triggers External file (experimental) • Box • Dropbox • FTP/SFTP • OneDrive • Google Drive
  19. 19. Copyright©SolidBeansAB Caveats
  20. 20. Copyright©SolidBeansAB Mattias Jiderhamn Cost management • Pay-as-you-go • Estimate memory usage and invocation time • More expensive = cheaper? • Async operations/ background threads • Low max time
  21. 21. Copyright©SolidBeansAB Mattias Jiderhamn Logging • ExecutionContext.getLogger() • AWS: Log4j 2 appender AWS Lambda Log4J appender CloudWatch Logs
  22. 22. Copyright©SolidBeansAB Mattias Jiderhamn Logging • ExecutionContext.getLogger() • AWS: Log4j 2 appender • TCP appender Function Async appender TCP appender
  23. 23. Copyright©SolidBeansAB Mattias Jiderhamn Cold start • 20-45 minutes of inactivity • 30+ seconds start for Java • Keep alive ping requests –Azure: per Function App
  24. 24. Copyright©SolidBeansAB Mattias Jiderhamn Vendor lock-in • Vendor specific method signature • Cloud Native Computing Foundation (CNCF) working on standard • Abstract the vendor specific … or not
  25. 25. Copyright©SolidBeansAB Mattias Jiderhamn Spring Cloud Function • Decouple business logic and deployment –Plain Old Function (POF) • Spring Boot –IoC etc • On the fly string compilation • Reactive Streams (Flux)
  26. 26. Copyright©SolidBeansAB DEMO
  27. 27. Copyright©SolidBeansAB Mattias Jiderhamn Ask not what you can do with
  28. 28. Copyright©SolidBeansAB fifty-shades-of-serverless @mjiderhamn