Diese Präsentation wurde erfolgreich gemeldet.
Wir verwenden Ihre LinkedIn Profilangaben und Informationen zu Ihren Aktivitäten, um Anzeigen zu personalisieren und Ihnen relevantere Inhalte anzuzeigen. Sie können Ihre Anzeigeneinstellungen jederzeit ändern.

Serverless / FaaS / Lambda and how it relates to Microservices

1.824 Aufrufe

Veröffentlicht am

#OUGN17 presentation about Serverless / FaaS / Lambda / Microservices

Veröffentlicht in: Internet
  • Hey guys! Who wants to chat with me? More photos with me here 👉 http://www.bit.ly/katekoxx
       Antworten 
    Sind Sie sicher, dass Sie …  Ja  Nein
    Ihre Nachricht erscheint hier

Serverless / FaaS / Lambda and how it relates to Microservices

  1. 1. munz & more Serverless Architectures OTNLaTAM AUG 2017 Dr. Frank Munz
  2. 2. 2 Frank Munz • Founded munz & more in 2007 • 17 years Oracle Middleware, Cloud, and Distributed Computing • Consulting and High-End Training • Wrote two Oracle WLS and one Cloud book
  3. 3. Oracle announced FaaS at OOW2016
  4. 4. AWS API: JSON Snippet munz & more #4
  5. 5. AWS SDKs munz & more #5 AWS language bindings Oracle language bindings, e.g. Java: https://github.com/oracle/bmcs-java-sdk
  6. 6. CLI munz & more #6 $ aws ec2 describe-regions --output table Oracle open sourced Bare Metal CLI https://blogs.oracle.com/de velopers/open-sourcing- bare-metal-cloud-services- cli
  7. 7. AWS Console: Services munz & more #7
  8. 8. Oracle Cloud Console munz & more #8
  9. 9. True Elasticity 9
  10. 10. Oracle: Pay Per Use
  11. 11. munz & more #11 https://www.blog.google/topics/google-cloud/google-invests-indigo-undersea-cable-improve-cloud-infrastructure-southeast-asia/
  12. 12. New Undersea Cable (Google) munz & more #12
  13. 13. Pay Per Use • You own a massively parallel and distributed and highly available supercomputer with linear costs • 100h of 1 instance = 1h of 100 instances • Your IT resources are not fixed anymore
  14. 14. Cloud Computing API Elasticity Pay per use Fully Programmable Data Center
  15. 15. PaaS IaaS Oracle Bare Metal Amazon EC2 Oracle ACCS AWS Beanstalk FaaS Oracle TBD AWS Lambda automatic elasticity. True pay per use. Min/Max, trigger, IaaS pricing API ✅ Elasticity? Pay per use? Container Service OCCS AWS ECS Launch Configuration +Autoscaling Groups +Scaling Events, pay /h / server Easy scaling (OCCS) IaaS pay per use pricing
  16. 16. Serverless
  17. 17. Serverless vs. FaaS munz & more #18 • AWS announced Lambda in 2014 as serverless. • Lambda is Function as a Service (FaaS) • PaaS is ”serverless” (in a broader sense) • FaaS is the cool thing – not “serverless” https://dzone.com/articles/serverless-architecture-1
  18. 18. Serverless Example: S3 munz & more #19 Replicated to 3 availability zones (=DC) Availability 99.99% Durability 99.999999999% (eleven 9s) 14 worldwide regions region -> API parameter Blob storage with RESTful Interface: PUT (key, value)
  19. 19. S3 munz & more #20 GET http://fmtestweb.s3-website.eu-central-1.amazonaws.com/
  20. 20. Serverless Example: S3 munz & more #21 • Never provision storage • Off instance service = NO server -> “serverless” • NO web server • $0,02 per GB + requests Werner Vogel’s blog is on S3: http://www.allthingsdistributed.com/
  21. 21. S3 is to data as FaaS is to code munz & more #22
  22. 22. FaaS
  23. 23. Edit Code Inline / Upload munz & more #24 npm node-lambda package for locally running and remotely deploying your node.js event: event passed to function context: runtime context callback: optional return (or null)
  24. 24. Definition: Function as a Service • Automated elasticity • True pay per invokation • Stateless • Event based munz & more #25 Definition • Choose memory -> compute power, I/O • Using container tech Characteristics
  25. 25. FaaS Implementations Amazon Google Microsoft Oracle Name Lambda Cloud Functions Azure Functions tbd Year 2014 2016 2016 2016 Status prod alpha beta announced Language Support NodeJS 4.3.2, Java 8, Python 2.7, .Net 1.0.1 C#, native Linux NodeJS JS, PHP, C#, F#, Python, bash, PowerShell ? Remarks Deploy from github or BitBucket, CLI Bundle functions, OneDrive and Bot Service integration Linked to Event Hub CS? Link https://aws.amazon.com/la mbda/ https://azure.microsoft.com/e n-us/services/functions/ https://azure.microsoft.com/en- us/services/functions/ https://cloud.oracle.com /home
  26. 26. Lambda Tech Details • Retries + dead letter Q • Metering in 100 ms (compute x time) • You can use environment variables, threads and start processes • Invocation times may differ • No scaling parameter munz & more #27
  27. 27. Lambda: Limits per Function munz & more #28
  28. 28. Cost Savings • Expedia(2016): – 2.3 billions calls – 200k hours / month – $ 550 a month • Postlight – API GW, Lambda, Serverless – Costs dropped 2 orders of magnitude to $ 370 munz & more #29 https://www.youtube.com/watch?v=gT9x9LnU_rE https://trackchanges.postlight.com/serving-39-million-requests-for-370-month-or-how-we- reduced-our-hosting-costs-by-two-orders-of-edc30a9a88cd
  29. 29. Events to Trigger Functions munz & more #30 Events from Cloud Service - API-Gateway - S3 - SNS - Kinesis - Cognito - Cloud Formation - Cloud Watch log / events / scheduled - Code Commit - Apps using AWS SDK λVendor lock-in? also multiple sources
  30. 30. Create Lambda munz & more #31 S3
  31. 31. Example 1: Simple Scenario munz & more #32
  32. 32. Test Code munz & more #33 1 2 34
  33. 33. API-Gateway Design and expose API to consumer, can trigger Lambda and brings more features: • Authentication • Traffic management • Import Swagger definitions • Create JavaScript, Android, iOS SDKs • XML to REST conversion • Uses Cloud Front (CDN) internally Pricing: #calls + outbound traffic (+cache) munz & more #34
  34. 34. Example 2: Image Recognition 35 https://github.com/awslabs/lambda-refarch-imagerecognition
  35. 35. Image Recognition munz & more #36 Extract meta data AI based ecognition Create thumbnail
  36. 36. 37 BaaS
  37. 37. Pay Per Use Every started request is charged: • First 1 million req/month are free + 400,000 GB seconds of compute time • $0.20 per 1 million req + $0.00001667 per GB second Lambda: free tier is forever. munz & more #38
  38. 38. Security
  39. 39. “Try to attack something that only lives for few milli-seconds” (AWS)
  40. 40. Gone in 60ms munz & more #41 https://www.youtube.com/watch?v=YZ058hmLuv0
  41. 41. Security • Not discussed here: Are Clouds Safe? • Small attack surface: – Container lifetime -> request = milli-seconds – No open ports – Not listening to an IP – You cannot call Lambdas directly: triggered by events “Exploit video” by CCC: “Gone in 60ms” munz & more #42
  42. 42. Microservices
  43. 43. Microservices Developing a single application as • a suite of small services • each running in its own process / owns it‘s data • communicating with lightweight mechanisms (M. Fowler / J. Lewis) https://martinfowler.com/articles/microservices.html
  44. 44. Frank Munz / OTN Latam 2016 #47 Service owns its data Less enterprise, more application centric Continuous Unlocking
  45. 45. munz & more #48 Is 𝛌 the new μ ?
  46. 46. FaaS vs. K8s Microservices FaaS fulfills M. Fowler’s microservices definition munz & more #49 AWS Lambda (compared to Docker with Kubernetes) ✅ Benefits of FaaS - “serverless” - zero config auto scaling - true pay per use -> higher abstraction Limits of FaaS - language/framework choice - resource limits - execution time / size limit - vendor lock-in -> reduced flexibility
  47. 47. A. Cockroft Ten years ago, a monolithic application was the best way to deliver business logic, … five years ago the best option shifted to microservices Today, another shift is taking place, to event driven functions (FaaS) munz & more #50 https://read.acloud.guru/evolution-of-business-logic-from-monoliths-through-microservices-to-functions-ff464b95a44d
  48. 48. Software
  49. 49. Serverless Framework Why a framework if your code runs in a “frame”? • Repeating patterns: IAM, API-GW, S3 bucket etc • NodeJS, Python, Java • AWS and Azure • Generates, deploys, runs Lambda in 3 LOC based on generated YAML + .py file munz & more #52https://serverless.com/
  50. 50. Serverless Framework munz & more #53
  51. 51. Hardware
  52. 52. - 100 TB Storage, 256 bit TPM - 3x 10 GB/s NICs - Cluster up to 5, 99.999% data durability - iSCSI, Ethernet, SIM Card - Lambda in Python: Greengrass - S3 PUT -> Lambda - Lambda functions -> public API, e.g. AWS - E-Ink Shipping label that updates - $ 300 / 10 days AWS Snowball Edge (FaaS in a Box):
  53. 53. AWS Greengrass Lambda in embedded devices • Linux 4.4+ • Locally execute Lambda triggered by local event • Greengrass Core + IoT SDK munz & more #56
  54. 54. TL;DR #serverless / #FaaS ”Serverless” ∋ FaaS / all major clouds / event driven / stateless / true pay per use / automatic scalability / integrates with other CS / vendor lock in? / -> cross-cloud frameworks emerge / 𝛌 could be the new µ! @frankmunz
  55. 55. www.linkedin.com/in/frankmunz/ www.munzandmore.com/blog facebook.com/cloudcomputingbook facebook.com/weblogicbook @frankmunz youtube.com/weblogicbook -> more than 50 web casts Don’t be shy J

×