- Keep Lambda deployment packages small to minimize cold starts.
- Separate core business logic from the handler function to allow unit testing.
- Reuse database connections outside the handler execution context.
- Keep Lambda deployment packages small to minimize cold starts.
- Separate core business logic from the handler function to allow unit testing.
- Reuse database connections and HTTP clients outside the handler execution context.
- Use environment variables for configuration instead of hardcoding values.
- Return appropriate HTTP status codes when responding to API Gateway events.