DEV Community

Discussion on: Solutions Architect Tips - Decoding the AWS Serverless Design Principles

Collapse
 
raphael_jambalos profile image
Raphael Jambalos

Great tips, Thanks Allen! On the first principle, "Speedy, Simple and Singular", I understand that one Lambda function should only do one thing. But more often than not, Lambda applications end up as a monolith, with one Lambda function serving as a different entrypoint to the application but still carrying the full application code nonetheless. How do you enforce having Lambda functions having only exactly what they need to function?

Collapse
 
allenheltondev profile image
Allen Helton

I think that comes down to governance. Make sure in your PRs people aren't building "lambdaliths"
That is a popular model I've seen, using something like express to essentially turn a lambda into a controller. According to the AWS best practices though, I don't think that's the recommended method.

Collapse
 
raphael_jambalos profile image
Raphael Jambalos

Agreed! but its so easy to regress into a monolith since the Serverless Framework / SAM allows the developer too much leeway.

Recently, I discovered serverless stack (serverless-stack.com/) as a kind of more mature framework that imposes some sort of convention to force the kind of separation, but even this has a tendency to grow several small Lambdaliths inside the repository.

What tools can you advise aside from Serverless Stack to do this? I cant seem to find any for Python...