Google App Engine Production-Like Environments - java

It would be nice if, once new code is tested, I could release changes to either a particular subdomain of my GAE app (such as demo.my-gae-app.com instead of my live environment at my-gae-app.com) or a particular backend instance (if subdomains are prohibited or not the right solution here).
Then, I can demo new code changes to my beta testers, and run performance tests against a real-life GAE environment. I know that the GAE SDK comes with a dev appserver, but it stubs most of the API calls, and doesn't handle scaling at all like a production environment would. And although we will absolutely use it for developers' local sandboxes as well as our QA environment, I just don't feel right release code into prod that hasn't ran against an environment that really mimics production.
How do other GAE developers/teams deal with this? I'm really just looking to have a pre-production environment (like "Demo")...but actually on live GAE app servers. Of course, I need to restrict access to this code so that only myself, my developers, my beta testers and our automated perf tests can access it... (that's the kicker).

You can deploy your code to a non-default application version, either by:
changing the version tag value in appengine-web.xml
calling appcfg.sh with -V version argument
changing the version in the deploy options of Google Eclipse plugin
After doing so, you can access your application by visiting version.appid.appspot.com
Note that different versions can access the same application datastore.

I registered a new application in Google app engine and deployed the beta version to it by changing project 's settings in eclipse. Then using google's tools (see Google doc) I copied the production datastore's content to the new beta app.
datastore in read-only mode while extracting data
Entity Keys could be problematic when working with unowned relationships - does anyone have information about this?
This provides me a perfect beta live environment.

Related

How to convert an Eclipse GAE Standard Environment Application to Flexible Environment?

I'm making my GAE app using Eclipse. All the plugins, and other functionalities involved support development for the Standard Environment. Is there a way to convert my current project to the Flexible Environment? Barring that, once uploaded to GAE, can this change be done online?
The Flexible environment is an almost entirely different beast than the Standard environment.
Support for various pieces of infra differs. You need to check each piece of infra you use in the Migrating Services from the Standard Environment to the Flexible Environment guide for an equivalent, if there is one. Effectively you'd be re-writing the app.
Note the service in above article title - the environment choice is done at the app service/module level, one can mix services with both environments inside the same app.
And no - the change can not be done online, you need to explicitly deploy the re-written app service to switch its environment.

How to change version of google app engine being used on server

I have built my google app engine app using version 1.8.8 but the production server hosted by google uses 1.9.11. I think this may be causing problems within my app since my app works locally but not on the production server. Is there anyway to change the version of the sdk that the production server uses? I can't seem to find any documentation on this.
No, you cannot define specifically which version of the SDK will run on the production servers. Typically, they run on the latest available SDK. If you are certain the that problems are caused due to the different versions of the SDK, I would propose to update your code accordingly.

Google Eclipse Plugin: Browser Plugin vs. Development Mode

I understand that Google's plugin for Eclipse tries to emphasize the "code-test-debug" cycle and make it as quick as possible, and that it comes with a medley of tools for doing just this.
What I don't understand is the need for a "developer" browser plugin for running your app inside Eclipse and testing locally on localhost. Why can't the plugin just start an embedded webserver and host it from there? Why does the browser require this plugin in the first place?
Tangential to that is the question of how it relates to development mode in general. Is Eclipse running in some kind of "special configuration" when in development mode that lets it talk with this browser plugin under the hood? If so, why is this necessary? Thanks in advance!
I believe you mixed two separate things here: GWT and GAE. GAE does not require browser plugin to run local dev server, while GWT requires browser plugin to run local dev mode (and even this is going away with 2.5 super devmode).
The confusion comes from the fact that Google bundles this two separate technologies into one plugin bundle, the GPE.
To avoid this just uncheck GWT when creating new GAE app.
Edit:
GWT dev plugin is only needed during dev mode. In this mode GWT Java source is not translated to javascript, but actually running in JVM as Java. This is needed to support debugging: https://developers.google.com/web-toolkit/doc/latest/DevGuideCompilingAndDebugging#DevGuideDevMode
Edit 2:
If you do not like the browser plugin, then you can use production mode on your local server. The downside to this is that compile-run will be greatly extended, since devmode compiles in-place: you can simply change GWT code and see changes by simply reloading browser window.

GAE Development - Development Environment Setup (HotSwap)

I'm quite new to develop on GAE. Need just sort out few questions about setting up development.
I'm currently using Eclipse 3.7.x, Google Suite Plugin 2.5.2 r37
Related links I found:
http://code.google.com/p/googleappengine/issues/detail?id=1787
GAE - Development server in Eclipse doesn't update?
http://code.google.com/p/gae-wtp-plugin/
I came from standard LAMP development environment. Changes are propagated immediately to development server (usually localhost) and I can control deployment of application to production server through DCVS/SVN and attached handlers updating remote codebase.
I'd expect Google Plugin allowing us to do the same. Necessary functions I (probably) need:
On-Save handler to recompile and update development code
Production like development environment (for testing in almost-real conditions)
Deployment to production environment
The last one is simply using DCVS/SVN to tag code and save the trunk branch, and using Google > Deploy to App Engine option to push it to remote server.
But how can I solve the first two requirements? Do I really need them, or is it only my hangover from web development, and development process in GAE works differently?
If the first one is solvable through GAE WTP Plugin, can you please more elaborate on how to setup development with this plugin, as I was not able to achieve anything more, than server, which has to be restarted in the same manner as Google Plugin default GAE development server
does.
You can update development code pretty quickly with the yellow reload button. For me, with about 100 server classes, this takes 2-5 seconds.
The development environment is reasonably good - you can simulate HRD and stuff like that. Of course, it's not actually a distributed cloud environment - we do most testing on local servers, and then have a whole test app on the cloud for a last round of simulation. Of course, some things change when 1000 people are accessing it at once, but I don't know how to get around that.
You can find the reload button on the Development View pane:

How to take a Java Web-application offline?

We develop Java Web-aps (Websphere, DB2) which display graphical and databased information. We would also like to offer the same application offline (distribution via CD/DVD) with online data-update. We have tried a number of alternatives in the past, but nothing has been really stable. What are the new best practices to take a Web ap plus data (in a small database) offline?
I don't know how well it works with the CD/DVD distribution front, but the first thing that comes to mind is Gears. On the .NET side of the fence there's Silverlight 2. Then there's the Mozilla Prism project, although I don't know how far advanced that is.
These are all designed for not just offline access, but mixed offline/online, talking to a server when it's available and working locally when necessary.
I'd suggest using Apache Derby as the database (also available as Sun's Java DB, and possibly still IBM Cloudscape (does that still have DB2 compatibility in place?)).
I'm sure there's plenty of Web servers/Servlet containers about. Apache Tomcat is the obvious one. An alternative approach would be to use an embedded native browser within a single Java process. That approach should be relatively hassle free for users and tech support, and you can just use WebStart to install and update.
If you're using EJBs and other nonsense, then there are similar freebies about. I understand Sun Glassfish is nice and fast starting.
You could create an image of your server as a VMware instance and distribute it with a copy of VMware player (licensing allowing of course). Personally I'd build it on top of a Linux distribution like CentOS5.
You can bundle a JRE along with JETTY server and use a different database e.g HSQLDB (that you can bundle inside the webapp itself).
If you are using an ORM tool to connect to database, you might not have to make many code changes for this.
A lot of Application server distribute their admin consoles like this.For e.g Weblogic admin console runs offline (it uses internal ldap server for its database)
Also as far as Google gears is concerned, they are also pretty much doing the same thing.
They have a server that is bundled along with SQLDB and they allow to synchronize the data between online offline app.
You can sync the data too (use webservices in the online app) and talk over https from the offline app to sync the data, if you need the sync feature.
Also you can check this link
http://developers.sun.com/learning/javaoneonline/2007/pdf/TS-69700.pdf

Categories