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

[PyCon Colombia 2018] Serverless for Pythonistas

[PyCon Colombia 2018] Serverless for Pythonistas

In this talk, I'm going to talk about the Serverless principles – such as single purpose functions and event-driven architecture –, use cases, drawbacks and opportunities. Since this architecture relies in cloud vendors, we are going to see how commercial and open source solutions are changing the way we build and create software. Of course Serverless isn't a silver bullet, but it can be a good choice.

On top of the paradigm, I'll show how the Python language fits in this new world, the tools, frameworks and design patterns used to create scalable and cheap applications, proving that even in this new hype of software development, simple is still better than complex.

67e79c99f3b6e205ebc68a6ab91545ad?s=128

Jonatas Baldin

February 10, 2018
Tweet

Transcript

  1. Serverless for Pythonistas

  2. Jonatas Baldin “jojo” Developer @ Maecenas Creator of Serverless Brasil

    @jonatasbaldin
  3. servers to serverless

  4. bare metal virtual machine OS container application

  5. bare metal virtual machine OS container application we cared about

    everything
  6. bare metal container application virtual machine OS

  7. bare metal container application virtual machin OS

  8. bare metal container application virtual machin OS

  9. bare metal container core application virtual machin OS

  10. bare metal container core application Third Party Auth Service Third

    Party File Storage Third Party Database Third Party Queue System virtual machin OS
  11. less servers more services

  12. why should you care?

  13. focus on problem solving

  14. we are in a constant search for abstraction and single

    purpose
  15. so, what is Serverless?

  16. None
  17. BaaS

  18. BaaS

  19. BaaS

  20. BaaS FaaS

  21. BaaS FaaS

  22. BaaS FaaS

  23. BaaS FaaS ⚡

  24. FaaS ✨ ✨

  25. ⚡ FaaS Principles ⚡ Event Driven Ephemeral Environments Built in

    Scalability Pay by Execution Lack of Management
  26. ⚡ FaaS Principles ⚡ Event Driven Ephemeral Environments Built in

    Scalability Pay by Execution Lack of Management
  27. sum(x, y) Event Driven

  28. sum(x, y) this is the function Event Driven

  29. sum(x, y) GET /api/sum?x=1&y=2 this is the trigger this is

    the function Event Driven
  30. sum(x, y) GET /api/sum?x=1&y=2 {“total": 3} this is the trigger

    this is the function this is the output Event Driven
  31. Event Driven

  32. resize(image) Event Driven

  33. resize(image) Event Driven

  34. resize(image) Event Driven

  35. ⚡ FaaS Principles ⚡ Event Driven Ephemeral Environments Built in

    Scalability Pay by Execution Lack of Management
  36. Ephemeral Environment resize(image)

  37. resize(image) Ephemeral Environment the function is not running

  38. resize(image) Ephemeral Environment

  39. resize(image) Ephemeral Environment $

  40. resize(image) Ephemeral Environment

  41. resize(image) Ephemeral Environment it’s destroyed

  42. ⚡ FaaS Principles ⚡ Event Driven Ephemeral Environments Built in

    Scalability Pay by Execution Lack of Management
  43. resize(image) Built in Scalability

  44. resize(image) Built in Scalability

  45. resize(image) Built in Scalability

  46. resize(image) Built in Scalability resize(image)

  47. resize(image) Built in Scalability resize(image) resize(image)

  48. Built in Scalability resize(image) resize(image) resize(image) resize(image)

  49. Built in Scalability resize(image) resize(image) resize(image) resize(image) resize(image)

  50. Built in Scalability resize(image) resize(image) resize(image) resize(image) resize(image)

  51. resize(image) Built in Scalability

  52. resize(image) Built in Scalability automagically

  53. ⚡ FaaS Principles ⚡ Event Driven Ephemeral Environments Built in

    Scalability Pay by Execution Lack of Management
  54. resize(image) Pay by Execution

  55. resize(image) Pay by Execution

  56. resize(image) Pay by Execution $

  57. resize(image) Pay by Execution

  58. resize(image) Pay by Execution

  59. resize(image) Pay by Execution

  60. ⚡ FaaS Principles ⚡ Event Driven Ephemeral Environments Built in

    Scalability Pay by Execution Lack of Management
  61. resize(image) Lack of Management

  62. Lack of Management resize(image) OS you can’t manage the server

    beneath
  63. but where does the code actually run?

  64. Providers

  65. resize(image) AWS Lambda

  66. resize(image) API Gateway S3 SQS DynamoDB … Lambda AWS

  67. resize(image) Lambda API Gateway S3 SQS DynamoDB … Anything, really

    AWS
  68. let’s open the black (pink) box

  69. What about the Pythonistas?

  70. Python 2.7 Python 2 & 3 Kubeless Azure (experimental) AWS

    Lambda IBM Cloud Functions
  71. ❤ Frameworks ❤

  72. aws/chalice

  73. None
  74. None
  75. Python is great for Serverless!

  76. Zappa + Django https://moriatoken.com

  77. BOND Zappa + Flask Ask + Alexa https://bondhome.io/

  78. @sls_telegram_bot https://github.com/jonatasbaldin/serverless-telegram-bot

  79. https://github.com/jacopotagliabue/ tensorflow_to_lambda_serverless TensorFlow Predctions

  80. vs C#

  81. Serverless Notes ™

  82. Things you should be aware

  83. Costs

  84. http://serverlesscalc.com/

  85. Analyse your use case

  86. None
  87. Vendor Lock-in

  88. None
  89. No server optimisations

  90. Visibility and testing are harder

  91. Ever growing complexity

  92. Youngness

  93. Future?

  94. @jonatasbaldin “jojo”

  95. Serverless for Pythonistas @jonatasbaldin “jojo”