In the past couple of years, I've seen a shift towards more and more serverless deployments. Many of those started off as just simple small ETL scripts where someone was shifting some data from one DB to another. Today we see continued investments from the major cloud providers into serverless with databases that can be pulled up on demand, frameworks inside of Kubernetes clusters, and even websocket support for AWS Lambdas.
Personally I have found the Serverless framework has gotten a lot more mature and have used it on multiple occasions ranging from quickly starting up proof of concepts to full blown financial applications that are PCI compliant.
As a startup, it's important to get off the ground running quickly and without creating a trail of technical debt along the way. Given we want to keep costs low early on when there isn't much traffic and we don't need super fast response times, how might we achieve business value velocity quickly while maintaining quality?
I naturally revisited serverless and built it with Node, Golang and Python. I found similar response times regardless especially when keeping the functions small. Eventually more PoCs and more start ups that I helped incubate started using Python. The speed to write it is quick, I can use monkey patching and the standard mocking libraries to create unit testable code.
What's more, I work very closely with lots of data scientists and their tool of preference in recent days has been Python. So when serving up .pkl files or models, it was easier to work along side them when using the same programming language. This also allowed them to dig into the back end code too when they wanted.
I pride myself on fast and high quality code and really love the craft. So I put together some of the learning and common functionality into my very first online course hosted by Udemy. I hope to receive some good feedback to improve.
It goes through a structured and scalable way to create serverless code on AWS. I also walk through creating the infrastructure using Terraform where VPCs, private and public subnets are created and finally through a complete authentication flow using Cognito.
If you happen to go through it and enjoyed it, please leave a rating.
If you're an experienced veteran, feel free to jump straight to the boilerplate: Serverless Python Boilerplate