Best way to automate the updating of google app engine datastore from external source?
I read "Best option for Google App Engine Datastore and external database", and I had already considered the SDC(we already use it for some things). However, I need to be able to automate the update of the datastore every 15 minutes or so. When using a cronjob in AppEngine there is no user attached to the actions, therefore it can't authenticate to the SDC. Note 开发者_开发问答that the external DB is behind a firewall(if it wasn't obvious by the SDC statement above).
Is there a way to get the SDC to work with some sort of scheduled+automated action? If not, what would be the recommended alternative?
I know it's kinda silly to answer your own question, but figured I may as well post my solution since there is no answer here.
What Nick left a comment about is definitely one option for solving the the problem, but what I found to be easier, and will work in the current situation is to push the data out rather than worry about securing an access point in the firewall with authentication.
I used the Remote API and created a Python application that will sit behind the firewall. On a scheduled cron, I query the data from SQL Server, query the data from the datastore for the app, and then add/update/delete the datastore with only the things that changed since the last run of the app. At this point I then push the data back up to the Datastore. For efficiency you can set it up to push out in batches as well(as is preached through the Datastore documentation).
This solution will work for the current app, but I could definitely see setting up a RESTful service with authentication for situations that this wouldn't be the best plan of attack.
精彩评论