After reading the docs
I think they are mostly the same.
I can use GAE cron job
+ pub/sub
+ cloud function
to implement the same functions which cloud scheduler
has.
In my understanding, it seems there are some differences between them:
Cloud Scheduler can be more convenient to adjust frequency. To update the frequency of GAE cron job
, you must update the config, like schedule: every 1 hours
of cron.yaml
and redeploy.
There is no need to implement the cron job architecture(integrate GAE
, GAE cron service
, pub/sub
, cloud function
, etc..) by yourself which means you don't need to write code for combining them together anymore.
Am I correct? Or, any other differences?
Cron jobs are scheduled at recurring intervals specified using the Unix cron format. You can define the schedule so that your job runs multiple times a day, or runs on specific days and months. This gets you any serverless articles delivered right to your inbox every day without you having to do a thing.
Cloud Scheduler is a fully managed enterprise-grade cron job scheduler. It allows you to schedule virtually any job, including batch, big data jobs, cloud infrastructure operations, and more. You can automate everything, including retries in case of failure to reduce manual toil and intervention.
Users are no longer required to create an App Engine application to use Cloud Scheduler.
You're right in that the Google Cloud Scheduler is kind of an evolution of the GAE cron job mechanism to make it more user-friendly and flexible. You can see that they are still related since the Cloud Scheduler doc specifies:
To use Cloud Scheduler your project must contain an App Engine app that is located in one of the supported regions. If your project does not have an App Engine app, you must create one.
Historically, GAE cron job was the only cron service offered by the platform. You could only target a GAE handler to receive the request from cron. From there you could indeed perform actions like like publish on pub/sub, call an HTTP Cloud Function or launch a dataflow job, but you always had to deploy a GAE service to handle it, which wasn't optimal.
The new Cloud Scheduler (still in beta as of now) makes it more straightforward to use with Pub/Sub, Cloud Functions but also any publicly available HTTP endpoint (may be on-premise). And of course App Engine handlers. More targets may be added in the future for more use-cases.
Finally, as you mentioned, the API exposed to manage it decouples it from App Engine and its cron.yaml file and makes it easier to create and update cron jobs dynamically.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With