首页 > 解决方案 > Pub/Sub vs Http in Cloud Functions Cron Jobs

问题描述

I want to make Cron Jobs by using Cloud Functions and Google Scheduler I know roughly what Publish / Subscribe is, I searched it. But I still don`t get it perfectly even I read it and over again.

there you have to choose one of three kinds (when you set Google Scheduler) 1. Pub / Sub 2. App engine http 3. Http (just)

Which one of these three should I choose?

I want to delete or set or update the some user`s information data set stored in Firestore in my Android app every night at 12 pm every night.

标签: google-cloud-platformfirebase-cloud-messaginggoogle-cloud-functions

解决方案


我假设如下: 1. 您使用 Cloud Function 更新数据 2. 您正在寻找在 GCP 中运行的调度程序解决方案

基于这些假设,您可以参考 Google 的这篇文章:https ://cloud.google.com/scheduler/docs/start-and-stop-compute-engine-instances-on-a-schedule ,调用流程将是:Cloud Scheduler -> Cloud Pub/Sub -> Cloud Function -> Cloud Firestore

还提到了为什么选择 Cloud Pub/Sub 而不是 HTTP(S),出于安全考虑,也建议您使用 Cloud Pub/Sub,但如果此处不需要身份验证,您应该自行决定

希望能帮助到你


推荐阅读