The Pragmatic Serverless Python Developer Opn305

Title

AWS re:Invent 2023 - The pragmatic serverless Python developer (OPN305)

Summary

  • Introduction: Etio Lessa, Chief Architect for PowerTools for AWS, and Ran from CyberArk presented the session.
  • Pragmatism in Serverless: The session focused on pragmatic decision-making in serverless projects, considering the context, team skills, and tools.
  • Use Case: A product API with synchronous and asynchronous parts was used to demonstrate pragmatic approaches.
  • Open Source Tools: The session highlighted four open source tools: MakeDocsMaterial, PyTest, PyIdentic, and PowerTools for AWS Lambda.
  • Project Structure: An opinionated project structure was presented, emphasizing the synergy between infrastructure as code, domain code, tests, and production readiness elements.
  • Architectural Layers: The concept of splitting code into handler, domain, and integration layers was discussed to improve scalability and maintainability.
  • Testing: The importance of testing with real cloud resources was stressed, covering unit, integration, and end-to-end tests.
  • Production Readiness: PowerTools for AWS Lambda was showcased for its ability to simplify best practices and improve developer experience.
  • Performance Optimization: Tools like Tuna, PySpy, and PyInstrument were recommended for analyzing and improving code performance.
  • Resources: Links to GitHub repositories, templates, and additional resources were provided for further exploration.

Insights

  • Pragmatism Over Best Practices: The session emphasized that while best practices are important, they must be applied pragmatically, considering the specific context of the project and team.
  • Open Source Tooling: The use of open source tools like MakeDocsMaterial, PyTest, PyIdentic, and PowerTools for AWS Lambda can significantly enhance the developer experience and streamline serverless application development.
  • Layered Architecture: Adopting a layered architecture (handler, domain, integration) can lead to more maintainable and scalable serverless applications by clearly separating concerns.
  • Testing with Real Resources: The presenters advocated for testing against real cloud resources rather than mocks to gain higher confidence in the code's functionality.
  • Performance Analysis: Tools like Tuna, PySpy, and PyInstrument provide valuable insights into code performance and can help identify bottlenecks and areas for optimization.
  • Resource Availability: The presenters provided a GitHub repository with documented decisions, code examples, and a project template to help attendees apply the discussed concepts in their own projects.