Need advice about which tool to choose?Ask the StackShare community!

AWS Lambda

+ 1
Google Cloud Functions

+ 1
Add tool

Google Cloud Functions or AWS Lambda - Help me decide


Amazon Web Services - Lambda and Google Cloud Functions are Serverless platforms; services set to execute scripts responding to specified events, such as a HTTP request or a database update. Serverless, or “Function-as-a-Service”, can be considered an evolution of Microservices, whereby applications are broken down to their smallest executable parts but without the always on server requirement of traditional Microservices. Since there are no servers to manage, Serverless deployments scale infinitely without hassle and without costly unused resources. Serverless is also inherently fault tolerant, as when a single execution fails, it has no impact on future or concurrent executions.

Both Lambda and Cloud Functions provide event hooks into existing services, enabling scripts to execute autonomously, thereby enhancing those services with custom business logic.

Amazon Web Services provide Lambda event hooks for:

Google provides Cloud Function event hooks for:

Serverless can be considered a glue which binds the services of its provider, enhancing their capabilities and enabling advanced flexibility and usefulness. However, through the use of an underlying runtime, Serverless scripts can also invoke functionality typical of Microservices, such as image manipulation, video transcoding and other data intensive tasks.

The Google Cloud Function platform provides runtime support for NodeJS versions 6 & 8 and has Python support in beta. AWS Lambda provides runtime support for NodeJS, Python, Java, Google Go and C#.

While AWS Lambda does provide more features and flexibility over Google Cloud Functions, the greatest power of Google Cloud Functions lies within its integration with Firebase. Firebase provides reactive data messaging throughput to applications, including message storage. When combined with Google Cloud Functions, additional server level functionality can be applied to messages in a pipeline like manner, greatly increasing the capabilities of the platform.

Another important feature of Google Cloud Functions is that its HTTP triggers are native, while AWS HTTP interfaces to Lambda require use of the AWS API Gateway service. This results in smaller and simpler scripts in Google Cloud Functions when handling HTTP requests.


While Microservices may typically degrade in performance with increasing numbers of requests, the reverse is often true of Serverless. The reason for this is that Serverless providers will only maintain scripts in a ready state if they are used frequently (hot start). If their use is infrequent, then they may take longer to spin-up prior to execution (cold start).

The delay in executing Serverless scripts can be problematic for some applications. As such, factoring start-up times into your application architecture is a must when using Serverless and the provider you choose may be important.

Cold start times are dependent on the scripting language used, the size of the function to execute, the number of executions already in progress and the period of time elapsed since the last execution. Both platforms typically experience an average delay of around a quarter of a second for warm starts, while cold starts may be as much as ten seconds or more. However, the pattern in which cold starts affect functions does differ between platforms, whereby AWS Lambda appears to have a larger delay at smaller load, while Google Cloud functions initially run more quickly, but tapering at higher load.


Average number of requests per second under incremental load for 5 minutes

The size of your project may also be a factor. AWS Lambda supports unlimited functions per project and will allow 1000 executions per account for each region. Google Cloud Functions, on the other hand, provide a cap of 1000 functions per project, with a maximum of 400 executions. However, with regard to execution time, AWS Lambda will timeout after five minutes, while Google Cloud Functions may execute for up to nine minutes, which may be more important for long running processes, such as video composition and transcoding.


Average response time under incremental load for 5 minutes

Google Cloud Functions is still technically in beta, so its performance may, and probably will, improve over time. As it stands, however, AWS Lambda is potentially more capable with high request rates over Google Cloud Functions.


Testing your Serverless scripts remotely can be both frustrating and time consuming. Deploying your scripts after making changes takes time and your scripts are not immediately available when uploaded, with both AWS Lambda and Google Cloud Functions taking around two minutes to fully deploy. Thankfully, both platforms provide command-line tools to assist in developing and testing your applications, locally.

AWS provides the SAM CLI; a development tool that makes it easier to create, develop, test and analyze Lambda functions. SAM is an abbreviation of Serverless Application Model. Ironically built in Google Go, the SAM CLI uses SAM templates to identify the content producers and consumers of your functions elsewhere in the AWS eco-system. SAM CLI supports each of the scripting languages supported by Lambda and runs on Windows, Mac OSX and Linux operating systems.

AWSTemplateFormatVersion: '2010-09-09'
Transform: AWS::Serverless-2016-10-31
Description: Processes videos
    Type: AWS::Serverless::Function
      Handler: videoProcessor.handler
      Timeout: 300
      Runtime: python3.6

Example SAM template

SAM CLI assumes no knowledge of your tests or testing framework, leaving you free to choose your own. It works by leveraging CloudFormation within a local Docker container and simulating the AWS environment on your own machine.

With the SAM CLI, you generate events that might occur in a live AWS environment.

$ sam local generate-event schedule > event.json

This produces a file you can customise and include in your testing environment to trigger your function.

    "source": "",
    "account": "123456789012",
    "version": "0",
    "time": "1970-01-01T00:00:00Z",
    "id": "cdc73f9d-aea9-11e3-9d5a-835b769c0d9c",
    "region": "us-east-1",
    "detail": {},
    "resources": [
    "detail-type": "Scheduled Event"

Example SAM event output

Similarly, Google provides an SDK tool called gcloud. This tool provides commands to manage many of Google's Cloud Services and not just Google Cloud Functions.

With gcloud, you can deploy your functions simply;

$ gcloud beta functions deploy myGetEndpoint --trigger-http

and invoke them with sample values;

$ gcloud beta functions call --data ‘{“id":43}’ myGetEndpoint

For local development, Google provides the Cloud Functions Node.js Emulator which, like SAM CLI, establishes a local setup that mimics the deployment environment. The emulator provides commands similar to gcloud, so you only need to learn a single API.

$ functions deploy myGetEndpoint --trigger-http
$ functions call --data ‘{“id":43}’ myGetEndpoint

As Google Cloud Functions are much simpler than AWS Lambda, events are provided simply as a passed flag. The options for such events include:

  • --trigger-http (HTTP endpoint)
  • --trigger-bucket (Google Cloud Storage)
  • --trigger-topic (Google Cloud Pub/Sub)
  • --trigger-event (other events, such as Firebase)


Monitoring of AWS Lambda functions occur automatically using CloudWatch which maintains running totals of your functions, including:

  • total function invocations
  • errors
  • execution duration
  • throttling due to exceeding limits
  • concurrent executions

To trace the event source and downstream calls from a function, AWS provides X-Ray. AWS X-Ray generates a Service Map of events and call details, along with function idle and execution times which expose the efficiency of your Lambda services within the greater application stack.

Google Cloud Functions also provides automatic monitoring of metrics, which includes:

  • invocation time
  • latency
  • errors
  • memory usage
  • CPU usage

These values are then provided as detailed visual graphs in the Google Cloud dashboard.

As with AWS, Google provides an additional service called Stackdriver. With this service, developers can search detailed logs created from the executing functions and even create alerts from a simple console.error invocation within the function itself.

AWS Lambda vs Google Cloud Functions: What are the differences?

Developers describe AWS Lambda as "Automatically run code in response to modifications to objects in Amazon S3 buckets, messages in Kinesis streams, or updates in DynamoDB". AWS Lambda is a compute service that runs your code in response to events and automatically manages the underlying compute resources for you. You can use AWS Lambda to extend other AWS services with custom logic, or create your own back-end services that operate at AWS scale, performance, and security. On the other hand, Google Cloud Functions is detailed as "A serverless environment to build and connect cloud services". Construct applications from bite-sized business logic billed to the nearest 100 milliseconds, only while your code is running.

AWS Lambda and Google Cloud Functions belong to "Serverless / Task Processing" category of the tech stack.

"No infrastructure" is the primary reason why developers consider AWS Lambda over the competitors, whereas "Serverless Applications" was stated as the key factor in picking Google Cloud Functions.

According to the StackShare community, AWS Lambda has a broader approval, being mentioned in 1002 company stacks & 585 developers stacks; compared to Google Cloud Functions, which is listed in 53 company stacks and 21 developer stacks.

Advice on AWS Lambda and Google Cloud Functions

Need advice on what platform, systems and tools to use.

Evaluating whether to start a new digital business for which we will need to build a website that handles all traffic. Website only right now. May add smartphone apps later. No desktop app will ever be added. Website to serve various countries and languages. B2B and B2C type customers. Need to handle heavy traffic, be low cost, and scale well.

We are open to either build it on AWS or on Microsoft Azure.

Apologies if I'm leaving out some info. My first post. :) Thanks in advance!

See more
Replies (2)
Anis Zehani

I recommend this : -Spring reactive for back end : the fact it's reactive (async) it consumes half of the resources that a sync platform needs (so less CPU -> less money). -Angular : Web Front end ; it's gives you the possibility to use PWA which is a cheap replacement for a mobile app (but more less popular). -Docker images. -Kubernetes to orchestrate all the containers. -I Use Jenkins / blueocean, ansible for my CI/CD (with Github of course) -AWS of course : u can run a K8S cluster there, make it multi AZ (availability zones) to be highly available, use a load balancer and an auto scaler and ur good to go. -You can store data by taking any managed DB or u can deploy ur own (cheap but risky).

You pay less money, but u need some technical 2 - 3 guys to make that done.

Good luck

See more

My advice will be Front end: React Backend: Language: Java, Kotlin. Database: SQL: Postgres, MySQL, Aurora NOSQL: Mongo db. Caching: Redis. Public : Spring Webflux for async public facing operation. Admin api: Spring boot, Hibrernate, Rest API. Build Container image. Kuberenetes: AWS EKS, AWS ECS, Google GKE. Use Jenkins for CI/CD pipeline. Buddy works is good for AWS. Static content: Host on AWS S3 bucket, Use Cloudfront or Cloudflare as CDN.

Serverless Solution: Api gateway Lambda, Serveless Aurora (SQL). AWS S3 bucket.

See more
Decisions about AWS Lambda and Google Cloud Functions
Cory Bell

Netlfiy Functions uses AWS Lambda under the hood, but Netlify adds some nice sugar. The biggest advantage is the local development experience with netlify-cli. This allows you to run your functions locally with local configuration or pull configs from the Netlify dashboard. I built a health-check endpoint in about 2 minutes, and my send-email function in less than an hour.

See more
Clifford Crerar
Software Engineer at Bidvest Advisory Services · | 9 upvotes · 60.5K views

Run cloud service containers instead of cloud-native services

  • Running containers means that your microservices are not "cooked" into a cloud provider's architecture.
  • Moving from one cloud to the next means that you simply spin up new instances of your containers in the new cloud using that cloud's container service.
  • Start redirecting your traffic to the new resources.
  • Turn off the containers in the cloud you migrated from.
See more

When adding a new feature to Checkly rearchitecting some older piece, I tend to pick Heroku for rolling it out. But not always, because sometimes I pick AWS Lambda . The short story:

  • Developer Experience trumps everything.
  • AWS Lambda is cheap. Up to a limit though. This impact not only your wallet.
  • If you need geographic spread, AWS is lonely at the top.
The setup

Recently, I was doing a brainstorm at a startup here in Berlin on the future of their infrastructure. They were ready to move on from their initial, almost 100% Ec2 + Chef based setup. Everything was on the table. But we crossed out a lot quite quickly:

  • Pure, uncut, self hosted Kubernetes — way too much complexity
  • Managed Kubernetes in various flavors — still too much complexity
  • Zeit — Maybe, but no Docker support
  • Elastic Beanstalk — Maybe, bit old but does the job
  • Heroku
  • Lambda

It became clear a mix of PaaS and FaaS was the way to go. What a surprise! That is exactly what I use for Checkly! But when do you pick which model?

I chopped that question up into the following categories:

  • Developer Experience / DX 🤓
  • Ops Experience / OX 🐂 (?)
  • Cost 💵
  • Lock in 🔐

Read the full post linked below for all details

See more
Get Advice from developers at your company using StackShare Enterprise. Sign up for StackShare Enterprise.
Learn More
What are some alternatives to AWS Lambda and Google Cloud Functions?
Build applications comprised of microservices that run in response to events, auto-scale for you, and only charge you when they run. This lowers the total cost of maintaining your apps, enabling you to build more logic, faster. The Framework uses new event-driven compute services, like AWS Lambda, Google CloudFunctions, and more.
Azure Functions
Azure Functions is an event driven, compute-on-demand experience that extends the existing Azure application platform with capabilities to implement code triggered by events occurring in virtually any Azure or 3rd party service as well as on-premises systems.
AWS Elastic Beanstalk
Once you upload your application, Elastic Beanstalk automatically handles the deployment details of capacity provisioning, load balancing, auto-scaling, and application health monitoring.
AWS Step Functions
AWS Step Functions makes it easy to coordinate the components of distributed applications and microservices using visual workflows. Building applications from individual components that each perform a discrete function lets you scale and change applications quickly.
Google App Engine
Google has a reputation for highly reliable, high performance infrastructure. With App Engine you can take advantage of the 10 years of knowledge Google has in running massively scalable, performance driven systems. App Engine applications are easy to build, easy to maintain, and easy to scale as your traffic and data storage needs grow.
See all alternatives