Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Do we need a serverless framework? With Python, I did not

172 views

Published on

Slides for the Barcelona Python Meetup that took place at Worldsensing on 2018, Feb, 22nd. Its goal was to share the experience when building a "Serverless" application with Python without needing any special framework.

Published in: Engineering
  • Be the first to comment

  • Be the first to like this

Do we need a serverless framework? With Python, I did not

  1. 1. Do we need a serverless framework? With Python, I did not
  2. 2. Serverless
  3. 3. Promises ● Cost reduction ● Flexibility ● Streamlined operations
  4. 4. @xtblg
  5. 5. Wait
  6. 6. Confusion in the land of the Serverless - Sam Newman - goto 2017
  7. 7. But
  8. 8. Designing for the serverless age - Gojko Adzic - goto 2017
  9. 9. Serverless: a computing model where a cloud platform executes user-provided functions in response to events at any scale. See FaaS. result = f(event, ...)
  10. 10. Complexity
  11. 11. Provider independence
  12. 12. cljs-lambda Serverless Claudia.js Apex
  13. 13. Operational tooling (deploy, test, etc) Very lightweight abstraction on top of events (claudia.js)
  14. 14. IaC tools
  15. 15. Claudia.js abstraction
  16. 16. Entities Use cases Controllers External Interfaces Dependencies Web / UI Frameworks DB Drivers Translation between external and domain concepts Application business rules Domain business rules Ports Adapters function
  17. 17. Serverless infra Handler Use case Entity Repository DB Driver handle do new save put End-to-end test Unit test Unit testUnit test Component test
  18. 18. __call__ magic method
  19. 19. Dependency Injection Container
  20. 20. Routing
  21. 21. Results encoding
  22. 22. Other potential decorators ● Simple argument validation (schema) ● Content negotiation ● Authentication ● ...
  23. 23. Result Returns dict shaped as an AWS lambda response
  24. 24. Deploying
  25. 25. Packaging
  26. 26. Zappa: WSGI-Lambda adapter
  27. 27. What I have learnt 1. No such a thing as provider independence with FaaS. 2. There are already really good tools to manage IaaC. 3. … and deployments. 4. Good architecture and test-first are simpler. 5. Python is really well suited to be used as the runtime. 6. Zappa is a special case.
  28. 28. Questions?

×