如何协调现有生产数据与 App Engine 中的架构更改?
假设您以特定方式设计 App Engine 模型类,将代码投入生产并允许用户与您的应用程序交互一段时间,从而将数据生成到 App Engine 数据存储区中。
现在,假设您决定对模型类之一进行更改。
是否有推荐的流程来执行此操作(在我的情况下是在 Java 应用程序中),以便当新代码投入生产时,它不会导致应用程序在针对具有旧模式的预先存在的数据运行时中断?
例如,在将任何新代码上传到生产之前,您是否应该下载生产数据并对其进行测试?
解决此类问题的最佳做法是什么?
Let's say you design your App Engine Model classes a particular way, you put your code into production and allow users to interact with your app for a while, generating data into the App Engine datastore.
Now, let's say you decide to make a change to one of your Model classes.
Is there a recommended process for doing this - in my case in a Java app - so that when the new code is put into production, it doesn't causing the app to break while running against the pre-existing data which has the old schema?
For example, should you download your production data and test against it before uploading any new code to production?
What are the best practices for this type of issue?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果架构更改允许,一种方法是延迟将需要架构更改的版本设置为默认版本,直到架构更改完成。
上传新版本,让它静置一段时间以更新索引,然后运行 MapReduce 来触及(并迁移)任何需要更新的实体。完成后,将新版本设为默认版本。
One approach, if your schema change allows for it, is to delay making the version that requires the schema change default until the schema change is done.
Upload the new version, let it sit for a while while indexes are updated, and then run a mapreduce to touch (and migrate) any entities that need to be updated. When that's done, make the new version default.