5 things not to do with Cloud Functions, and 5 things you absolutely should do instead
Sara Ford
Senior Developer Relations Engineer
Martin Skoviera
Technical Solutions Engineer
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.