开发者

How do you reconcile existing production data with a schema change in App Engine?

开发者 https://www.devze.com 2023-03-23 20:08 出处:网络
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 datas

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 fo开发者_运维问答r this type of issue?


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消