Slide 1

Slide 1 text

Showdown of the serverless cloud, orchestrating functions

Slide 2

Slide 2 text

Kenny Baas-Schwegler @kenny_baas Baasie.com xebia.com/blog/author/kbaas/ Marc Duiker Azure Consultant - I ❤ Serverless Strategic software consultant - Domain-Driven Design @marcduiker blog.marcduiker.nl

Slide 3

Slide 3 text

No content

Slide 4

Slide 4 text

Let’s look at the specs!

Slide 5

Slide 5 text

Type​ AWS Lambda​ Azure Functions​ Google Cloud Functions​ Price 1M Executions​ ($) 0.20​ 0.20​ 0.40​ Price GB-s​ ($) 0.00001667​ 0.000016​ 0.0000025​ Price GHz-s ($) - - 0.0000100 Free executions/month​ 1M​ 1M​ 2M​ Free GB-s/month​ 400K​ 400K​ 400K​ ​Free GHz-s/month ​- ​- ​200K Total​ cost/month ($) ​78.48 75.40 92.70 Comparing Cost* * For 10M function executions of 1 sec each using a 512MB / 800MHz machine. @kenny_baas @marcduiker

Slide 6

Slide 6 text

Runtimes AWS Lambda​ Azure Functions​ Google Cloud Functions​ Node.js v6 & v8 v6, v8, v10 v6 & v8 (beta) .NET Framework ​- v4.7​ ​- .NET Core v1, v2.x v2.x -​ Python v.2.7, v3.6 & v3.7 v3.6 (preview)​ v3.7.1​ (beta) Java ​v8 v8 (preview) -​ Ruby v2.5 - -​ Go v1.x -​ v1.11(beta) Comparing Runtimes @kenny_baas @marcduiker

Slide 7

Slide 7 text

Comparing Cold Start Source: https://mikhail.io/2018/08/serverless-cold-start-war/ @kenny_baas @marcduiker

Slide 8

Slide 8 text

No content

Slide 9

Slide 9 text

Parking Garage Use Case

Slide 10

Slide 10 text

You get a FAAS @kenny_baas @marcduiker

Slide 11

Slide 11 text

Everybody gets a FAAS @kenny_baas @marcduiker

Slide 12

Slide 12 text

Flying Spaghetti Functions https://clearlens.org/do-you-believe-in-a-flying-spaghetti-monster/

Slide 13

Slide 13 text

@kenny_baas @marcduiker

Slide 14

Slide 14 text

No content

Slide 15

Slide 15 text

No content

Slide 16

Slide 16 text

@kenny_baas @marcduiker

Slide 17

Slide 17 text

Question: How do we split systems into functions? Heuristic: Within a bounded context modules are a perfect candidate for splitting up into functions. Heuristic: Use one source control repository per bounded context. @kenny_baas @marcduiker

Slide 18

Slide 18 text

@kenny_baas @marcduiker

Slide 19

Slide 19 text

SDK Portal Monitoring Orchestration Documentation Testing

Slide 20

Slide 20 text

“Everything we hear is an opinion, not a fact. Everything we see is a perspective, not the truth.” ― Marcus Aurelius , Meditations @kenny_baas @marcduiker

Slide 21

Slide 21 text

Documentation - AWS @kenny_baas @marcduiker

Slide 22

Slide 22 text

Documentation - AWS @kenny_baas @marcduiker

Slide 23

Slide 23 text

23 Documentation - Azure @kenny_baas @marcduiker

Slide 24

Slide 24 text

24 Documentation - GCloud @kenny_baas @marcduiker

Slide 25

Slide 25 text

25 Documentation + - AWS Lambda ● Extensive, detailed documentation. ● Everything you need! ● Extensive wall of text crits you Azure Functions ● Quickstarts for novices ● Detailed reference material for the more experienced. ● Not 100% complete across all languages. GCP Functions ● Quickstarts for novices. ● Hard to find specific information @kenny_baas @marcduiker

Slide 26

Slide 26 text

SDK - AWS https://www.npmjs.com/package/@types/aws-lambda @kenny_baas @marcduiker

Slide 27

Slide 27 text

SDK - AWS @kenny_baas @marcduiker

Slide 28

Slide 28 text

SDK - AWS @kenny_baas @marcduiker

Slide 29

Slide 29 text

SDK - AWS @kenny_baas @marcduiker

Slide 30

Slide 30 text

30 SDK - Azure @kenny_baas @marcduiker

Slide 31

Slide 31 text

31 SDK - Azure @kenny_baas @marcduiker

Slide 32

Slide 32 text

SDK - GCP @kenny_baas @marcduiker

Slide 33

Slide 33 text

SDK - GCP https://www.npmjs.com/package/@types/google-cloud__datastore @kenny_baas @marcduiker

Slide 34

Slide 34 text

SDK - GCP @kenny_baas @marcduiker

Slide 35

Slide 35 text

35 SDK + - AWS Lambda ● Flexible SDK, extensive. ● Can also create your own runtime. ● Quirks in the gateway body as string. Need to do validation yourself, also typed. Azure Functions ● Easy to use SDK for C#. ● Be careful of certain NuGet package versions the framework is using (e.g. NewtonSoft.Json). GCP Functions ● Using standard 3th party libraries. @kenny_baas @marcduiker

Slide 36

Slide 36 text

Orchestration - AWS https://github.com/binxio/aws-cfn-update @kenny_baas @marcduiker

Slide 37

Slide 37 text

Orchestration - AWS @kenny_baas @marcduiker

Slide 38

Slide 38 text

Orchestration - AWS @kenny_baas @marcduiker

Slide 39

Slide 39 text

Orchestration - Azure

Slide 40

Slide 40 text

40 SDK - Azure @kenny_baas @marcduiker

Slide 41

Slide 41 text

Orchestration - GCP Not supported OOTB :( @kenny_baas @marcduiker

Slide 42

Slide 42 text

Orchestration + - AWS Lambda ● Visualisation in the portal ● Uses JSON/YAML configuration. Azure Functions ● Flexibility because the orchestration is in code. ● The orchestration needs to be deterministic, so don’t use code which is not (e.g. new GUIDs, DateTime, new threads). GCP Functions ● N/A ● N/A @kenny_baas @marcduiker

Slide 43

Slide 43 text

Deployment Cycle - AWS @kenny_baas @marcduiker

Slide 44

Slide 44 text

Deployment Cycle - AWS @kenny_baas @marcduiker

Slide 45

Slide 45 text

Deployment Cycle - AWS https://xebia.com/blog/building-an-elixir-runtime-for-aws-lambda/ @kenny_baas @marcduiker

Slide 46

Slide 46 text

Deployment Cycle - Azure

Slide 47

Slide 47 text

Deployment Cycle - Azure

Slide 48

Slide 48 text

Deployment Cycle - GCP @kenny_baas @marcduiker

Slide 49

Slide 49 text

49 Deployment Cycle + - AWS Lambda ● Stateful Cloudformation. ● Sometimes manual interference when config is false. Azure Functions ● Multiple ways to deploy your functions to the cloud. ● Prefer CLI over ARM. ● Watch out for breaking changes in orchestrations. GCP Functions ● Terraform to the rescue! ● Google Cloud deployment configuration counter intuitive. @kenny_baas @marcduiker

Slide 50

Slide 50 text

Portal - AWS @kenny_baas @marcduiker

Slide 51

Slide 51 text

Portal - AWS

Slide 52

Slide 52 text

Portal - Azure

Slide 53

Slide 53 text

Portal - Azure

Slide 54

Slide 54 text

Portal - GCloud @kenny_baas @marcduiker

Slide 55

Slide 55 text

55 Portal + - AWS Lambda ● Most parts are simple and easy to discover. ● No real boundaries of projects. ● Some parts are hard to navigate. Azure Functions ● Resource Groups are useful containers for multiple services. ● It is very slow to use. GCP Functions ● Projects is good concept for grouping services. ● Portal is quick to use. @kenny_baas @marcduiker

Slide 56

Slide 56 text

56 Testing - AWS @kenny_baas @marcduiker

Slide 57

Slide 57 text

57 Testing - AWS AWS SAM LOCAL @kenny_baas @marcduiker

Slide 58

Slide 58 text

58 Testing - Azure

Slide 59

Slide 59 text

59 Testing - Azure @kenny_baas @marcduiker

Slide 60

Slide 60 text

60 Testing - Azure @kenny_baas @marcduiker

Slide 61

Slide 61 text

61 Testing - Azure @kenny_baas @marcduiker

Slide 62

Slide 62 text

62 Testing - Azure @kenny_baas @marcduiker

Slide 63

Slide 63 text

63 Testing - GCP @kenny_baas @marcduiker

Slide 64

Slide 64 text

64 Testing + - AWS Lambda ● Unit testing is easy ● SAM Local seems promising ● SAM Local still in beta ● Mocking dynamo takes some time to understand Azure Functions ● Unit testing is easy ● Local runtime is available for running without cloud connection. ● Local runtime depends on a separate storage emulator (not all versions are compatible). GCP Functions ● Node Emulator available for local testing. ● Emulator is in alpha version ● Supports Node v6 only @kenny_baas @marcduiker

Slide 65

Slide 65 text

Monitoring - AWS @kenny_baas @marcduiker

Slide 66

Slide 66 text

Monitoring - Azure

Slide 67

Slide 67 text

Monitoring - GCP

Slide 68

Slide 68 text

68 Monitoring + - AWS Lambda ● CloudWatch is mature, gives the right amount of stats Azure Functions ● Basic logging OOTB and easy integration with Application Insights. GCP Functions ● Basic monitoring OOTB @kenny_baas @marcduiker

Slide 69

Slide 69 text

Key takeaways Question: When do we use AWS? Heuristic: When we want to use many different function runtimes. Heuristic: When we want to use the latest runtimes. @kenny_baas @marcduiker

Slide 70

Slide 70 text

Key takeaways Question: When do we use Azure? Heuristic: When we’re familiar with the Microsoft ecosystem. Heuristic: When we want to orchestrate functions. @kenny_baas @marcduiker

Slide 71

Slide 71 text

Key takeaways Question: When do we use Google Cloud? Heuristic: When we want the best functions portal experience. @kenny_baas @marcduiker

Slide 72

Slide 72 text

Key takeaways Question: When should we use Orchestrations? Heuristic: Use orchestrations within a bounded context. Heuristic: Use orchestrations when having processes over multiple modules in your bounded context. Heuristic: Use orchestrations for long running processes. @kenny_baas @marcduiker

Slide 73

Slide 73 text

73 Pricing https://aws.amazon.com/lambda/pricing/​ https://azure.microsoft.com/en-us/pricing/details/functions/​ https://cloud.google.com/functions/pricing​ Comparison: https://docs.google.com/spreadsheets/d/1Q6vllVYe1CfHAK6MP6Uz6mTYPiU4DljwL8XN4E5FQdw/edit?usp=sharing Runtimes & languages​ https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html https://docs.microsoft.com/en-us/azure/azure-functions/supported-languages​ https://cloud.google.com/functions/docs/writing/​ Cold Start https://mikhail.io/2018/08/serverless-cold-start-war/ ​ Sources Github Repository with our demo code https://github.com/Baasie/serverless-showdown @kenny_baas @marcduiker