Converting Backends to Modules
The original App Engine architecture is based on a single frontend instance with optional backend instances. If you have an application that uses backends, you may want to convert the backends to module format to take full advantage of the additional functionality that modules provide (such as the ability to version backends).
App Engine automatically runs an existing backend as a new, non-default version of the default module. Resident backends are assigned manual scaling and dynamic backends are assigned basic scaling.
You can convert backend instances to named modules that are versioned and have explicit scaling type and instance classes. You must replace the original backends.xml file with multiple WAR files, one for each module. The procedure is as follows:
Create a top level
EARdirectory.Create a
META-INFsubdirectory in theEARdirectory that contains anappengine-application.xmlfile and anapplication.xmlfile.Add module declaration elements to the
appengine-application.xmlfile.Create a subdirectory in the
EARdirectory for each module in the app including the default module. By convention, each subdirectory has the same name as the module it defines.Copy the contents of the original
WARdirectory into each subdirectory. The originalWARshould have a subdirectory namedWEB-INF. Each new subdirectory must have its own copy of that directory.Add module configuration elements (to define module name, scaling, instance class, etc.) to the
appengine-web.xmlfiles in each subdirectory.Application configuration files (
cron.xml,dispatch.xml,dos.xml, etc.) should only be included in the default module subdirectory. Remove these files from all the other module subdirectories.
For example, here is a file example/backends.xml that defines three backends (memdb, worker, and cmdline):
To convert these backends to modules, first assume you've created a new EAR directory called "ear." Declare the backends as modules in the file ear/META-INF/application.xml. Notice that this file also declares the default module as well:
The configuration for each module is written in a separate appengine-web.xml file, under the corresponding subdirectory. In ear/memdb/WEB-INF/appengine-web.xml:
In ear/worker/WEB-INF/appengine-web.xml:
In ear/cmdline/WEB-INF/appengine-web.xml: