What is the recommended way to temporarily disable my Google App Engine app so that I can perform schema migration?

半城伤御伤魂 提交于 2019-12-22 08:34:59

问题


I'd like to disable user access to my app so that I can perform a schema migration. I've looked into a few possibilities and found possible shortcomings:

  1. Disable datastore writes - I'd rather just bring my whole application down so that people do not see any errors, etc. Also, I assume disabling writes will prevent me from performing the migration.

  2. Disable the application - It's not clear to me that this would disable it only for my users, leaving me unable to perform the migration. I am also unsure of the disable/enable turnaround time.

  3. Redirect my domain name to a temporary page - my app would still be accessible on appspot.com

  4. Upload a new version of my app that doesn't respond to requests other than to direct to a "temporarily down" page.

Any suggestions?


回答1:


Suggestion number 4 seems like probably the best way to do this. Some frameworks have a "maintenance mode" in which all incoming requests would be redirected to a page indicating the site is down due to maintenance. If your framework doesn't support such a mode, you can just upload a new version of your app (maybe call the version maintenance) and switch to that as your new default version. This version could be an empty app in which all incoming requests are turned to a "maintenance page" indicating the site is down for maintenance. Then manually go to the version of your app with the migration code and execute it (http://<version>.<appname>.appspot.com). Switch your apps default version to the new version with the new schema when you're done with the migration.

Explanation of your other ideas

  1. Disabling writes would prevent even you from making writes on the application. I believe this was more meant for migrating from one app to another or other applications of "freezing" the datastore.
  2. Disable the application would bring the app down entirely
  3. Redirecting your domain would inflict a DNS lag on your migration, something that can take 48 hours to fully propagate each way (switching to the temporary page, then switching back to the new version)
  4. As aforementioned, IMHO this would be the best way to do it.



回答2:


Is it not possible to use both schema's, and use a new version of your app to migrate, which only uses the new schema. In this way you can always fall back to your old version.

By the way. Because the datastore is schema-less, It was always possible for me to change the "schema", without bringing the app down.



来源:https://stackoverflow.com/questions/14798032/what-is-the-recommended-way-to-temporarily-disable-my-google-app-engine-app-so-t

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!