Running multiple apps on one App Engine instance

43 views
Skip to first unread message

Jens Scheffler

unread,
Apr 15, 2008, 10:38:11 PM4/15/08
to Google App Engine
Hi,

I'm thinking about trying to build a "multiplexer" to run several apps
from one app-id
(I summarized the general idea at http://aef.appspot.com/multiplexer
). I was wondering if somebody else has already investigated this
approach and could tell me his or her experience? Is it feasible?

Cheers,

Jens

Bryan A. Pendleton

unread,
Apr 16, 2008, 12:04:58 AM4/16/08
to Google App Engine
I've tinkered with this a little. My approach so far has been pretty
simple... define each app in its WSGIApplication, then a simple
splitting function like so: (My app.yaml also has a pretty generic
regexp for this .py file)

if server.startswith("mydomain.here") :
wsgiref.handlers.CGIHandler().run(firstApplication)
else:
wsgiref.handlers.CGIHandler().run(defaultApplication)

I don't think this is a very good idea, in general, but it would allow
for a number of low-volume apps on a single app slot.

On Apr 15, 10:38 pm, Jens Scheffler <schefflerj...@gmail.com> wrote:
> Hi,
>
> I'm thinking about trying to build a "multiplexer" to run several apps
> from one app-id
> (I summarized the general idea athttp://aef.appspot.com/multiplexer

Jens Scheffler

unread,
Apr 16, 2008, 2:31:12 AM4/16/08
to Google App Engine
Thanks for the feedback.

> My approach so far has been pretty
> simple... define each app in its WSGIApplication, then a simple
> splitting function

I've done stuff like that before, but I had a couple of issues:

- if I split up my apps over several scripts, it gets confusing to
tell those apart
- I cannot easily use common datastructures (like a model-class called
"UserSettings") in more than one app

That's why I was thinking along the lines of putting each app into its
own subdirectory, and doing some framework magic to persist the models
for each app into its own "namespace". I think that if that can be
achieved in a relatively generic way, one could actually run a
multitude of apps very well within one instance. Also, as an added
benefit, one could push the namespace thing even further and create
different namespaces for different domains (like in the "blog" example
I mentioned before)

Longer term, one could then even "reverse" this trend for shared
datastructure amongst apps (think of a mail and a calendar app that
share a common contact list in the database).

Cheers,

Jens

Andrew Burton

unread,
Apr 16, 2008, 11:42:11 AM4/16/08
to Google App Engine
On Apr 16, 1:31 am, Jens Scheffler <schefflerj...@gmail.com> wrote:
> - I cannot easily use common datastructures (like a model-class called
> "UserSettings") in more than one app

You could always just dedicate one of your applications to data
handling, and call information from it via a web service.

Jens Scheffler

unread,
Apr 16, 2008, 11:58:19 AM4/16/08
to Google App Engine
I could, but that would add additional latency and complexity. My goal
is to get as close as possible to just being able to drop several apps
in subfolders and have them run without any modifications. Kindof like
"My app needs a wiki? Just download an open source one and drop it in
a subfolder..."
Reply all
Reply to author
Forward
0 new messages