Monday, August 8, 2022
No menu items!
HomeCloud Computing5 things not to do with Cloud Functions, and 5 things you...

5 things not to do with Cloud Functions, and 5 things you absolutely should do instead

Over the past several weeks, you’ve seen a collection of the most common questions and misconceptions the Cloud Functions Support team sees about Cloud Functions. Here is a recap of these most common “anti-patterns” and what you should do instead:

How to write event-driven Cloud Functions properly by coding with idempotency in mind: We explored what idempotent functions are and how this design pattern is important for background-triggered functions.

How to reuse Cloud Function instances for future invocations: We covered what global scope is for a Cloud Function, when to use, and what issues to look out for when used incorrectly.

How to establish outbound connections correctly:  We explained how to make outbound connections correctly by using explicit timeouts on your outbound calls. 

How to handle Promises correctly in your Node.js Cloud Function: We shared how to verify that you are handling promises correctly in Node.js to avoid saving undefined or cached data in your database.

How to run background processes correctly in Python: We cautioned why you should avoid running background tasks in Cloud Functions and explained why we recommend using Cloud Tasks instead.

We hope you’ve found this series helpful! Please let us know if you have any questions or ideas about best practices using Cloud Functions. You can reach us at @GoogleCloudTech on Twitter.

Related Article

Avoiding GCF anti-patterns part 5: How to run background processes correctly in Python

Fifth post in a series on how to avoid anti-patterns in Google Cloud Functions as seen by the Support team. This post explores how Python…

Read Article

Cloud BlogRead More

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments