Clean Architecture for Serverless: Business Logic You Can Take Anywhere
summary
Build claim: Kotlin business logic stays cloud-agnostic and reusable across AWS Lambda and Azure Functions by splitting code into domain, application and infrastructure modules and injecting cloud adapters only at the edge. Demo builds a serverless "mocknest" that maps requests, saves mappings to S3 or Azure Blob via a small persistence interface, and deploys with Spring Cloud Function, CDK Terraform in Kotlin and GitHub Actions. Uses headless Gradle modules, shows mapping code, verifies S3/blob contents, and discusses cold-start mitigation (Lambda SnapStart, Azure Elastic Premium).
AI-written summary · about
chapters (24)
- 0:00Introduction and speaker intro
- 1:30What is serverless and FaaS
- 2:56Spring Cloud Function overview
- 4:00Deploying to Azure Functions
- 6:09Deploying to AWS Lambda
- 7:56Business logic with clean architecture
- 10:07Domain layer examples
- 11:53Project structure and modules
- 13:11Mapping cloud events to domain
- 17:21Plugging in persistence layer
- 21:40Infrastructure with Terraform CDK
- 22:23Demo: Azure Function setup
- 22:44Demo: AWS Lambda setup
- 27:05Demo: GitHub Actions workflow
- 28:31Demo: AWS functionality test
- 30:17Demo: Azure functionality test
- 31:21Demo: Storage verification
- 32:26Key takeaways and benefits
- 35:16Try at home and resources
- 36:31Q&A: Cold start and overhead
- 38:59Q&A: Serverless vs Kubernetes
- 42:40Q&A: Integration testing
- 45:54Q&A: Mocking infrastructure
- 47:19Q&A: Terraform deployment
