Everyone knows that I’m a Lambda fanboy, and to be fair Lambda deserves all the praise it gets, it is **the** gold-standard for serverless functions. But yesterday, I gave Google Cloudrun a spin, and boy(!) is Lambda is going to get a run for its money.
Which is surprising given Google has traditionally lagged in this area — isn’t it quaint that we use words like ‘traditional’ in the serverless world!
But I digress.
The Lambda equivalent in the Google world, is Google cloud functions … which is roughly what Lambda was 2 years ago — pretty boring. The only advantage I saw it having over Lambda, was the ability to build python packages natively in the
But that incurred a build during deploy, which in turn had a limit. And while, it did allow for a larger package size (double what AWS Lambda offers) it was severely more complex to understand. Just looking at it’s limit and pricing models can make you dizzy. In short, Google Cloud functions lacked the simplicity of Lambda, with little benefit for incurring all that additional complexity.
But Cloud Run is something else. It’s still more complex than lambda, but here the trade-off seems worth it. So let’s take a peek at Google’s new serverless Golden Boy!
In Lambda the atomic unit of compute is the function, which for an interpreted language (like Python & JS) is pure code written in plaintext. But in Cloud Run the atomic unit is the container — and that can be a container for just the one function, or the container for the entire app itself.
Now why would you need apps for the serverless world?! You ask indignantly. Aren’t these all supposed to be function based?
Well actually, I answer snobbishly, lots of people have legacy code written at the application level! Duh!