Jonny
Jonny

Reputation: 16338

Separate datastore data from debug and live versions of app

What is the best approach to separate the data from the debug version and the live one?

The question and answers here describe how to separate the code logic: https://stackoverflow.com/a/8550105/129202

Still the datastore data is shared between all versions.

I imagine any of these:

Upvotes: 0

Views: 120

Answers (2)

Tim Hoffman
Tim Hoffman

Reputation: 12986

You can't seperate data based on versions.

You could use name space, but I wouldn't

I would use a different instance and copy the production data to that instance, then run all your testing there, with complete confidence you are working with a separate data set.

Some of my projects, data is very specific to companies/users and we set up test companies and test users, but that approach is very dependent on the types of updates, and how segmented your data is. If you have multi-tenant data then you will probably already be using namespaces.

Upvotes: 3

IanGSY
IanGSY

Reputation: 3714

You could use namespaces, when storing data in the Datastore, see this Google doc for more information. One for live and one for debug, and have this defined in the app.yaml for each version as an environmental variable.

Upvotes: 2

Related Questions