martend
martend

Reputation: 51

What is best practice to run an app scheduled in google app engine?

I created a very small app that calls an external website, receives JSON data and stores it as a JSON file in my app root folder. What is best practice in Google Cloud / App engine to automate this app?

Upvotes: 0

Views: 48

Answers (1)

Mangu
Mangu

Reputation: 3325

Reading at your scenario, you would have to go with the cron.yaml option, aka, the Cron service, but there are some bits that need explaining. Bear in mind that some of these links are for Python, but you can switch to your programming language, which you haven't mentioned in the question:

  • 'receives JSON data and stores it as a JSON file in my app root folder'. You can't write to local disk in App Engine Standard, and the disk in App Engine Flexible is ephemeral, so, I wouldn't rely on it. If you want to store this information, I would recommend using Cloud Storage, there are libraries to use it from both Standard and Flexible.
  • If you go with Standard, you can use both the queue.yaml option, aka the Task Queue service, and the Cron service. In this case, I would recommend going with the Cron service, as it's much simpler to configure that the Task Queue service. You just need to configure the cron.yaml file to hit your application at the time you want, and that's it. I would only recommend the Task Queue service if your requests exceeded the limit of 60 seconds that all requests have in App Engine Standard, as with the Task Queue service you can 'drop' this task in a Queue.
  • If you decide to go with Flexible, bear in mind that the Task Queue service has limited availability on this environment. As for the Cron service, the configuration is more or less the same.

So, in the end, I would go with App Engine Standard, combined with Cloud Storage to keep the JSON files, as the Standard environment is also cheaper than the Flexible environment.

Upvotes: 1

Related Questions