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

In the land of Serverless, who uses Zappa is king! by Jonatas Baldin

7b0645f018c0bddc8ce3900ccc3ba70c?s=47 Pycon ZA
October 05, 2017

In the land of Serverless, who uses Zappa is king! by Jonatas Baldin

Serverless is an architecture style where we don't have servers*, dealing just with third-party services. This means infinite scaling, less downtime and less maintenance. Of course this is not the answer for every problem, but it can be a good choice.

Together with this concept, there's Zappa, a framework that makes that easily to deploy Python WSGI applications with AWS Lambda and AWS API Gateway.

In this talk, we're going to discuss about the concept and the tool, deploying a web Python application with Zappa!

Kidding: Serverless still has servers ;)

7b0645f018c0bddc8ce3900ccc3ba70c?s=128

Pycon ZA

October 05, 2017
Tweet

Transcript

  1. In the land of Serverless, who uses Zappa is king!

  2. @jonatasbaldin Developer at Cheesecake Labs

  3. None
  4. None
  5. BaaS Backend as a Service FaaS Function as a Service

  6. Serverless Principles

  7. Single Purpose Functions

  8. Event-Driven Architectures

  9. Abstracted Servers

  10. Ephemeral Environments

  11. Pay by Execution

  12. Builtin Scalability

  13. Commercial Providers

  14. Open source Providers

  15. None
  16. None
  17. None
  18. None
  19. Use Cases Web Backends Bots Data Processing IoT

  20. Benefits COST

  21. Benefits COST CO ST

  22. Benefits COST CO ST CO ST

  23. Benefits COST CO ST CO ST COST

  24. Benefits COST CO ST CO ST COST COST

  25. Benefits COST CO ST CO ST COST COST COST

  26. Benefits COST CO ST CO ST COST COST COST COST

  27. * First 1 million requests per month are free *

    $0.20 per 1 million requests thereafter ($0.0000002 per request)
  28. None
  29. Benefits Infinite Scale Package and Deploy Time to Market Operational

    Management*
  30. Do you mean... #NoOps?

  31. Every time you say NoOps, a sysadmin dies.

  32. Serverless doesn't remove Ops complexity, it increases it exponentially

  33. Enough concepts, let's talk about tooling

  34. Serverless Frameworks* It's been two years since the first one

    and we already have like 20+ frameworks
  35. Serverless Frameworks* It's been two years since the first one

    and we already have like 20+ frameworks
  36. Serverless Frameworks* It's been two years since the first one

    and we already have like 20+ frameworks WHY?
  37. Everything is new It's not easy Lot of moving pieces

    No specs whatsoever
  38. None
  39. None
  40. None
  41. FEATURES!

  42. Python WSGI Applications Great for micro AND macro services AWS

    Lambda + AWS API Gateway AWS Event Sources Cron-like Events Logs Rollback
  43. Environment variables from S3 Multiple stage deployments Django Management Commands

    (yeah!) Keep Warm Free SSL Globally Distributed Availability
  44. $ pip install zappa

  45. $ zappa init

  46. # zappa_settings.json { "dev": { "aws_region": "us-east-1", "django_settings": "hello.settings", "profile_name":

    "default", "project_name": "hello", "runtime": "python3.6", "s3_bucket": "zappa-huyg6op0s" } }
  47. $ zappa deploy

  48. # Deployment complete!: <some_url>

  49. None
  50. None
  51. None
  52. None
  53. $ zappa update dev

  54. $ zappa rollback dev -n 2

  55. $ zappa tail dev

  56. $ zappa invoke dev "print('PyConZA')" --raw

  57. $ zappa manage dev migrate

  58. # zappa_settings.json { "dev": { ... }, "staging": { ...

    }, "production": { ... } }
  59. $ zappa deploy staging

  60. And much more! https://github.com/Miserlou/Zappa

  61. Drawbacks Vendor control/lock-in* No server optimizations No in-server state

  62. Opportunities Tooling Open source projects Learning and teaching *LOTS OF*

    improvements
  63. And the question that everyone is wondering....

  64. Is it production ready?

  65. YES! but try if first

  66. Serverless Weekly http://eepurl.com/cUU8sD

  67. In the land of Serverless, who uses Zappa is king!

    @jonatasbaldin
  68. Obrigado!