Google Functions

  • Author: Ronald Fung

  • Creation Date: 8 June 2023

  • Next Modified Date: 8 June 2024


A. Introduction

Google Cloud Functions is a serverless computing platform provided by Google Cloud that allows developers to build and run event-driven applications and backend services. With Google Cloud Functions, developers can write code in popular programming languages such as Node.js, Python, Go, and Java, and deploy it as a function that automatically scales up or down in response to incoming events or traffic.

Google Cloud Functions provides a fully managed environment that takes care of infrastructure management, security, and scaling, allowing developers to focus on writing code. Developers can trigger functions in response to events from Google Cloud services such as Google Cloud Storage, Google Cloud Pub/Sub, and Google Cloud Firestore, as well as from external sources such as HTTP requests or webhooks.

Google Cloud Functions supports a pay-per-use pricing model, which means that developers only pay for the resources consumed by their functions when they are running. This makes it a cost-effective solution for building event-driven applications and backend services that require low-latency, high-throughput data processing.

Overall, Google Cloud Functions is a powerful and flexible serverless computing platform that allows developers to build event-driven applications and backend services with ease, while providing high scalability, reliability, and cost-effectiveness.


B. How is it used at Seagen

Seagen can use Google Cloud Functions as a serverless computing platform to build and run event-driven applications and backend services on the Google Cloud Platform. If you are already using Microsoft Azure, you can integrate Google Cloud Functions with your current cloud infrastructure using various tools and services provided by Google Cloud, such as Google Cloud Pub/Sub, Google Cloud Storage, and Google Cloud Dataflow.

To get started with Google Cloud Functions, Seagen can follow these steps:

  1. Create a Google Cloud account: If you haven’t already, create a Google Cloud account and enable billing for the account.

  2. Install the Google Cloud SDK: Install the Google Cloud SDK on your local machine to access Google Cloud Functions from the command line.

  3. Create a Google Cloud Function: Create a Google Cloud Function using the Google Cloud Console, the gcloud command-line tool, or a client library such as the Node.js client library.

  4. Configure the function: Configure the function to trigger in response to events from Google Cloud services such as Google Cloud Storage or Google Cloud Pub/Sub, or from external sources such as HTTP requests or webhooks.

  5. Write the function code: Write the function code in the programming language of your choice, such as Node.js, Python, or Go.

  6. Test the function: Test the function using the Google Cloud Console or a client library to ensure that it is working as expected.

  7. Deploy the function: Deploy the function to the Google Cloud Platform using the Google Cloud Console, the gcloud command-line tool, or a client library.

  8. Monitor the function: Monitor the function using the Google Cloud Console or Stackdriver Logging to ensure that it is running correctly and to troubleshoot any issues.

Overall, Google Cloud Functions can be a powerful and flexible serverless computing platform that Seagen can use to build event-driven applications and backend services that can scale automatically and handle high throughput data processing. With its pay-per-use pricing model and seamless integration with other Google Cloud services, Google Cloud Functions can be a cost-effective and efficient solution for Seagen’s biopharma research projects.


C. Features

Connects and extends services to build complex applications

Cloud Functions lets you treat all Google and third-party cloud services as building blocks. Connect and extend them with code, and rapidly move from concept to production with end-to-end solutions and complex workflows. Further, integrate with third-party services that offer webhook integrations to quickly extend your application with powerful capabilities.

End-to-end development and diagnosability

Go from code to deploy, with integrated monitoring. Get full observability and diagnosability for your application with Cloud Trace. Additionally, get support for local and disconnected development/debugging using open sourced functions framework.

Develop locally, scale globally

Serve users from zero to planet-scale without even thinking about any infrastructure. Cloud Functions automatically manages and scales underlying infrastructure with the size of workload.

No server management

Deploy your code and let Google run and scale it for you. Cloud Functions abstracts away all the underlying infrastructure, so that you can focus on your code and build applications faster than ever before.

Runs code in response to events

Cloud Functions allows you to trigger your code from Google Cloud, Firebase, and Google Assistant, or call it directly from any web, mobile, or backend application via HTTP.

Pay only for what you use

You are only billed for your function’s execution time, metered to the nearest 100 milliseconds. You pay nothing when your function is idle. Cloud Functions automatically spins up and backs down in response to events.

Avoid lock-in with open technology

Use open source FaaS (function as a service) framework to run functions across multiple environments and prevent lock-in. Supported environments include Cloud Functions, local development environment, on-premises, Cloud Run, Cloud Run for Anthos, and other Knative-based serverless environments.


D. Where Implemented

LeanIX


E. How it is tested

To test Google Cloud Functions, you can follow these steps:

  1. Create a Google Cloud Function: First, create a Google Cloud Function using the Google Cloud Console, the gcloud command-line tool, or a client library such as the Node.js client library.

  2. Write the function code: Write the function code in the programming language of your choice, such as Node.js, Python, or Go.

  3. Test the function locally: Use a local testing tool such as the Cloud Functions Emulator or a local development environment to test the function locally on your machine.

  4. Deploy the function: Deploy the function to the Google Cloud Platform using the Google Cloud Console, the gcloud command-line tool, or a client library.

  5. Test the function in the cloud: Test the function in the cloud using the Google Cloud Console or a client library to ensure that it is working as expected.

  6. Monitor the function: Monitor the function using the Google Cloud Console or Stackdriver Logging to ensure that it is running correctly and to troubleshoot any issues.

Some tips for testing Google Cloud Functions:

  • Use different testing scenarios to test different aspects of the function, such as testing for edge cases and error handling.

  • Use logging and monitoring tools to track the function’s behavior and performance, and to identify any errors or issues that may arise.

  • Test the function’s scalability by triggering it with different levels of traffic and monitoring its response time.

  • Use test automation tools to automate the testing process and ensure consistent and reliable results.

Overall, testing Google Cloud Functions involves creating a function, writing code, testing locally, deploying to the cloud, testing in the cloud, and monitoring the function’s behavior and performance. By following these steps and testing the function thoroughly, you can ensure that it works correctly and reliably in production.


F. 2023 Roadmap

????


G. 2024 Roadmap

????


H. Known Issues

While Google Cloud Functions is generally a highly reliable and stable serverless computing platform, there are a few known issues that users may encounter. Some of the known issues are:

  1. Cold start latency: When a function is triggered for the first time, it may experience a cold start latency, which means that it takes longer to respond than subsequent requests. This can impact applications that require low latency and high throughput.

  2. Limits on function execution time and memory: Google Cloud Functions has limits on function execution time and memory usage, which can impact applications that require long-running or memory-intensive tasks.

  3. Limited integration with third-party tools: Google Cloud Functions has limited integration with third-party tools and services compared to other serverless computing platforms, which can make it challenging to use with certain development workflows.

  4. Limited support for debugging and testing: Google Cloud Functions has limited support for debugging and testing, which can make it challenging to troubleshoot issues and ensure that functions are working correctly.

  5. Limited availability in some regions: Google Cloud Functions may not be available in all regions, which can limit its usefulness for applications with specific geographic requirements.

Overall, while these issues may impact some users, Google Cloud Functions remains a highly scalable, reliable, and flexible serverless computing platform that is well-suited for modern cloud-based applications. By carefully designing and testing functions to work within the limits of the platform, and by using the tools and services provided by Google Cloud, users can minimize the impact of these issues and build robust and reliable applications.


[x] Reviewed by Enterprise Architecture

[x] Reviewed by Application Development

[x] Reviewed by Data Architecture