Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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?

like image 271
Kpt Avatar asked Nov 05 '22 17:11

Kpt


1 Answers

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.

like image 82
Dave W. Smith Avatar answered Nov 09 '22 10:11

Dave W. Smith