Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Get rid of your servers - use functions!

233522f6a55d788094a97a4be3d37b23?s=47 manu rink
November 22, 2016

Get rid of your servers - use functions!

Serverless Computing for the WIN. With a lot of links to example code and how-to-start tutorials :)

233522f6a55d788094a97a4be3d37b23?s=128

manu rink

November 22, 2016
Tweet

More Decks by manu rink

Other Decks in Programming

Transcript

  1. Get rid of your servers! Use functions ☁ + </>

    = Manuela Rink Technical Evangelist @
  2. #0 The Theoretical Part* *no excuses – first part needs

    to be theory!
  3. Transformation from own “iron” to cloud VMs

  4. Transformation from VMs to microservices / functions

  5. We’ve come a long long way together The cloud evolution

  6. Serverless or Jeff* or “just the next pig which is

    chased through the village?” * Serverless is just a name, Paul Johnston
  7. “[…] is a cloud computing code execution model in which

    the cloud provider fully manages starting and stopping virtual machines as necessary to serve requests, and requests are billed by an abstract measure of the resources required to satisfy the request, rather than per virtual machine, per hour.” -- Wikipedia https://en.wikipedia.org/wiki/Serverless_computing
  8. “Quick and easy run your code*, in the cloud, without

    worrying about infrastructure, maintenance or scaling.” *of various size -- Manu Rink, 2016
  9. AWS Lambda GA since April 2015 Google Cloud Functions Public

    Alpha Late 2015 IBM Cloud Functions Public Beta Early 2016 “Äscha” Functions GA since November 2016
  10. #1 Functions!!!11eleven *not long until the demos, I swear!

  11. Inspired by Chris Anderson @ Microsoft

  12. Inspired by Matthew Henderson @ Microsoft

  13. “Function App” is a group of functions Inspired by Matthew

    Henderson @ Microsoft
  14. Inherit from / Build on top of App Services Full

    control of dependencies and connectors Choose your fav language and coding environment Powerful integration into your existing Azure apps Choose from a wide variety of triggers 100% operated Open sourced
  15. App Service Features and Capabilities Enterprise Grade Apps Designed for

    secure mission-critical applications Fully Managed Platform Optimized for Availability and Automatic scale High Productivity Development Agility through Continuous Deployment Hybrid Connections / VPN / VLAN Scheduled Backup Azure Active Directory Integration Site Resiliency, HA, and DR Web Jobs Role Base Access Control Audit / Compliance Enterprise Migration Client Certs Cache IP Restrictions/ SSL Web Sockets SQL, MySQL, DocDB, & Mongo Sticky Sessions Authorization/ Authentication Automated Deployment AutoScale Built-in Load Balancing Worldwide Datacenter Coverage End Point Monitoring & Alerts App Gallery DR Site Support WildCard Support Dedicated IP address HTTP Compression CDN Support for Websites Premium WordPress App Services Environments Remote Debugging w/ Visual Studio Site Staging Slots Testing in Production Continuous Integration/Deployment Git, Visual Studio Online and GitHub App & Site Diagnostics OS & Framework Patching Site Extensions Gallery NET, PHP , Python, Node, Java Framework Installer Browser-based editing Auto-Healing Logging and Auditing Admin-Site Support Site Extension Inspired by Matthew Henderson @ Microsoft
  16. Templates • Azure Internal Service Triggers • Blob • EventHub

    • Storage Queue • Service Bus Queue • Service Bus Topic • Generic Triggers • Generic WebHook • GitHub WebHook • Http • Timer Languages • Core • C# • JS/Node • Experimental • PowerShell • TypeScript • Python • PHP • F# • Bash
  17. #2 Building the real stuff*! … in 4 stages *finally!

  18. Yeaaah, but what can I build with ’em?

  19. Scenario 0 The Easy Cake use HTTP trigger to provide

    HTTP endpoints to build a Hello Cake endpoint
  20. Scenario 0 – Easy cake! – Simple HTTP endpoint

  21. Scenario 0 – Easy cake deployment! All together in a

    bash script Single Azure CLI statements
  22. Y A X B Easy Cake LIVE DEMO

  23. Scenario 1 Connect all the things! use web hooks for

    wiring up heterogeneous services to connect Slack with your mobile backend
  24. Scenario 1 - Connect all the things! – Slack &

    mobile backend The Serverless Connector - Use Functions to write Slack posts in your mobile backend
  25. Y A X B Connect all the things! LIVE DEMO

  26. Scenario 2 Like a pro! use Blob Trigger to let

    function react on storage I/O of other function to build an image resizing service
  27. Scenario 2 - Like a pro! – Image Resizing Service

    https://github.com/codePrincess/resizingService
  28. Scenario 2 - Like a pro! – Image Resizing Service

  29. https://github.com/codePrincess/resizingService Scenario 2 - Like a pro! – Image Resizing

    Service
  30. Y A X B Like a pro! LIVE DEMO

  31. Scenario 3 The Fun Stuff! use OCR of CS Computer

    Vision API and text detection logic in a function to build an identification card validation service
  32. Scenario 3 – The fun stuff! – ID card validation

    service https://github.com/codePrincess/funkyVerfication
  33. None
  34. Y A X B The fun stuff! LIVE DEMO

  35. #3 a Penny saved is a penny goT* *’nuff said!

  36. Cool stuff so far … and the costs?

  37. *for the 1 million executions and the first 400.000 GB/s

    It’s free*
  38. Function executes 2.000.000 times with a duration of 1 second

    using 1536MB RAM Resource consumption costs 2 million exec * 1 second = 2 million seconds 1536 MB / 1024 MB = 1.5 GB 1.5 GB * 2 million seconds = 3 million GBs 3 million GBs – 400000 GBs = 2.6 million GBs 2.6 million GBs * 0.000014 $/GBs = 41.60 $ Execution costs 2 million exec - 1 million exec = 1 million exec 1 million exec * 0.20$ = 0.20$ 41.60$ + 0.20$ = 41.80$ Pricing Overview Pricing Calculator Same example – just with 128MB RAM 0 $ + 0.20$ = 0.20$ Resource consumption costs 2 million exec * 1 second = 2 million seconds 128 MB / 1024 MB = 0.125 GB 0.125 GB * 2 million seconds = 0.25 million GBs 0.25 million GBs – 400000 GBs = 0 GBs 0 million GBs * 0.000016 $/GBs = 0 $ Execution costs 2 million exec - 1 million exec = 1 million exec 1 million exec * 0.20$ = 0.20$
  39. Consumption Plan Scaling on demand – 100% managed Quota Definition

    as Spending Limit
  40. App Service Plan Scaling depending on plan Cost are fixed

    with the plan’s tier Basic Standard Premium ~55€ ~75€ ~225€
  41. #4 ... This is the end!

  42. Easy to build & deploy – 100% operated Various languages

    supported Lot of triggers available Inter-connectable in- & outside of Azure Cost effective
  43. #5 ... Where to go from here?

  44. Serverless on Azure https://azure.microsoft.com/en-us/overview/serverless-computing/ Azure Functions documentation https://docs.microsoft.com/en-us/azure/azure-functions/ Blogposts with

    How-Tos and source code to all examples in this deck https://medium.com/royallyserverless Nice and neat link and learning material https://blogs.msdn.microsoft.com/appserviceteam/2016/12/01/running-azure-functions-locally-with-the-cli/ https://www.npmjs.com/package/azure-functions-cli https://contos.io/azure-functions-cli-quick-start-ee843dfbe72c#.v90g0n77d Brandnew – Azure Functions now part of the Serverless Framework https://serverless.com/framework/docs/providers/azure/ It’s dangerous to go alone - take this!
  45. Merci :) Manu Rink Technical Evangelist marink@microsoft.com @codeprincess says