Managing Dev and Live versions

97 views
Skip to first unread message

Martin Waller

unread,
Sep 23, 2011, 4:38:14 AM9/23/11
to Google App Engine
I was wondering what the best advice is for managing a live version of
an app and a dev version of an app? I found the following on the web:

1. App Versions are strings, not numbers
Although most of the examples show the 'version' field in app.yaml and
appengine-web.xml as a number, that's just a matter of convention. App
versions can be any string that's allowed in a URL. For example, you
could call your versions "live" and "dev", and they would be
accessible at "live.latest.yourapp.appspot.com" and
"dev.latest.yourapp.appspot.com".
2. You can have multiple versions of your app running simultaneously
As we alluded to in point 1, App Engine permits you to deploy multiple
versions of your app and have them running side-by-side. All the
versions share the samedatastore and memcache, but they run in
separate instances and have different URLs. Your 'live' version always
serves off yourapp.appspot.com as well as any domains you have mapped,
but all your app's versions are accessible at
version.latest.yourapp.appspot.com. Multiple versions are particularly
useful for testing a new release in a production environment, on real
data, before making it available to all your users.
Something that's less known is that the different app versions don't
even have to have the same runtime! It's perfectly fine to have one
version of an app using the Java runtime and another version of the
same app using the Python runtime.

What I don't like about this is that all the versions share the same
datastore and memcache which is fine if you want to test on live data
but if you want a test datastore where to can delete everything and go
again then it's not going to work. How do people manage this? Do they
setup two distinct apps to do this I wonder?

Many thanks for any help you can give.

Martin

Brandon Wirtz

unread,
Sep 23, 2011, 4:49:09 AM9/23/11
to google-a...@googlegroups.com
In my stuff...

App Versions for "Live" are pure numbers, all Devs/debug/beta contain Alpha
Characters

If INT Version == Version { DataStore/Memcache = Live} Else
{DataStore/Memcache = Debug}

For memcache make sure to prefix or differentiate your keys in some way.

Depending on my testing often I do reads from live always and writes to the
live or debug based on version.

I often mix Java and Python between Versions so I can run performance
testing between the two.

Martin

--
You received this message because you are subscribed to the Google Groups
"Google App Engine" group.
To post to this group, send email to google-a...@googlegroups.com.
To unsubscribe from this group, send email to
google-appengi...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/google-appengine?hl=en.


Tim Hoffman

unread,
Sep 23, 2011, 5:25:14 AM9/23/11
to google-a...@googlegroups.com
Hi

I run a complete separate instances for dev/test/uat with their own data.

Then final testing with live data in production instances before making the new version the default.


Rgds

Tim


Martin Waller

unread,
Sep 23, 2011, 6:02:49 AM9/23/11
to google-a...@googlegroups.com
Hi,

Does that mean you create a different application for each dev/test - as shown on the "My Applicatiions" Page. I'm not sure how you create different instance in the cloud, I can see how you might do it on a local test server. If you do upload multiple versions - by changing appengine-web.xml - you could have instances of the different version running but do they not share datastore and memcache?

Martin

--
You received this message because you are subscribed to the Google Groups "Google App Engine" group.
To view this discussion on the web visit https://groups.google.com/d/msg/google-appengine/-/Gc-EWjmFwEYJ.

Jeff Deskins

unread,
Sep 23, 2011, 11:04:31 AM9/23/11
to google-a...@googlegroups.com
I created a different application under "My Applications" for my test server.  That way I don't have to worry about Test data getting mixed in with Production data.  This also allows me to do any kind of load testing without interfering with the live site.  I can then adjust the code after reviewing appstats to optimize performance.

Once I move it to production, I verify it is working properly under that new version name/number before setting is as the default, as Tim said.

Jeff

Murph

unread,
Sep 29, 2011, 8:51:44 AM9/29/11
to google-a...@googlegroups.com
You should also take a look at multitenancy / namespaces (same feature, 2 different names for it).

http://code.google.com/appengine/docs/python/multitenancy/

I'd guess it can also be done in Java, my GAE experience is all Python.  In Python, you setup the default namespace for a request in your appengine_config.py based on more or less whatever logic you want, so easy to do it based on the URL hostname prefix.  The namespace effectively gives a soft partitioning of the datastore & memcache (I say "soft", as it's possible for a request handler to access all namespaces, if it wants to).
Reply all
Reply to author
Forward
0 new messages