3 ms·
We're doing that with cloud functions, pubsub and pulumi, the infra code to set that up is trivial, and it is actually a lot easier to maintain since it's fully
by fvdessen 4y ago
We're doing that with cloud functions, pubsub and pulumi, the infra code to set that up is trivial, and it is actually a lot easier to maintain since it's fully serverless & you get retries and parallelism 'for free'. With cronjobs on vms the job itself might be a bit easier to code, but everything around it is a lot harder. (What happens if your 5h job crashes in the middle, who restarts it ? How do you manage locks to prevent concurrent execution ? How do you prevent that job from overloading the system ? etc ...)
just to clarify our setup:
- 1 pubsub 'job' queue
- 1 cloud function triggered by a scheduled event populates the job queue
- 1 idempotent cloud function to handle a job, triggered by events on the queue.