Search code examples
firebasegoogle-cloud-firestoregoogle-cloud-tasks

Google cloud task or cloud Scheduler


I'm trying to achieve a similar function as blablacar has, app users can post leisure plans. So every leisure plan has a start date and an end date (even for more than 30 days), when a leisure plan ends I want to send a push notification. If a user publishes a leisure plan, I can create a task in the cloud, the problem is that if the finish date is greater than 30 days, this approach no longer works for me. I thought about using cloud scheduler, what happens is that I do not know if it would be very expensive to make queries to see which dates are finished about 3 times a day.

What approach should I take?


Solution

  • As you can see here "Cloud Scheduler pricing is based exclusively on the job... The actual running of a job is called an execution. A job is not billed for individual executions". That means that it does not matter the number of times you execute a job, you always be charged for a job (in case you only have 1).

    In addition, Cloud Scheduler allows you to have up 3 free jobs per month, per billing account. So, if you need to use 4 jobs for this task, you only will be charged for 1 (the other 3 are free).

    Finally, the other important thing to take into account is from where you are going to retrieve that information (Cloud SQL, Datastore, etc). This is to estimate a cost for all the resources you are going to use.

    I think that a good option to estimate this is to use the GCP Calculator.