5

I have one project ID in Google App Engine. Is it possible to use the same project ID to deploy multiple apps. Apps may be in Java or Python, are are not connected to each other in any way. If this is possible, then can we determine the url that will be used to access the app ?

aks
  • 458
  • 1
  • 5
  • 16

2 Answers2

7

Yes, it is possible. You can have as many "apps" as you need, as long as each one has its own entry point. For example:

   myapp.appspot.com/free.html
   myapp.appspot.com/premium.html
   myapp.appspot.com/admin.html

All of these apps will have access to the same data in Datastore, files in Cloud Storage, etc., but otherwise they can perform very different functions (e.g. user app, admin portal, setup wizard, and so on).

Because all of these "apps" would share data, they are often called "modules", which may be a better term if their functionality is closely related.

EDIT:

Note that the concept of "apps" or "modules" as it applies to your own application should not be confused with the concept of "services" in App Engine. You can have multiple "apps" served by the same "service".

Andrei Volgin
  • 40,755
  • 6
  • 49
  • 58
  • 1
    Modules have been renamed to `services`; at the moment, either `module:` or `service:` should work in your YAML. https://cloud.google.com/appengine/docs/python/an-overview-of-app-engine – E. Anderson Aug 17 '16 at 22:49
  • @E.Anderson: I meant "modules" within the context of user applications - as the word has been used for a long time (e.g. "Student portal" module, "Parent Portal" module, etc.) You are correct that within App Engine "modules" (now "services") have a different, very specific meaning. There is no direct relationship between user-side apps/modules and modules/services within App Engine. – Andrei Volgin Aug 18 '16 at 00:25
  • @andrei-volign: Services are limited to 20 (https://cloud.google.com/appengine/docs/standard/python/an-overview-of-app-engine#limits) per project. You might want to update your answer. – Eduard Wirch Dec 04 '17 at 07:24
  • @EduardWirch: Each URL does not have to map to a unique service. You can have 50 URLs all pointing to a single service, and this service can handle them all. In fact, that's a typical use-case, e.g. a backend service handling dozens of endpoints like "/user", "/account", "/login", etc. – Andrei Volgin Dec 07 '17 at 04:32
  • @adrei-volign: You write "You can have as many 'apps' as you need", and then "Because all of these 'apps' would share data, they are often called 'modules'". So basically you say "you can have as many modules as you need". There was a modules concept in gcloud, which was renamed to "services". Someone reading your answer must get the impression that you're talking about services. And the final point: the documentation I linked states, that the upper limit for services is 20. – Eduard Wirch Dec 07 '17 at 07:44
  • @EduardWirch - I added an explanation to the answer which I already gave in the comments a year ago: "apps" or "modules" in application sense are different from the concept of "services" in GAE. – Andrei Volgin Dec 07 '17 at 13:47
2

You can use it by deploying to different versions. But they will share datastore, queues, quotes, budget, etc. So you would need to make sure this apps do not use same entity kinds for examples.

You can access different versions on subdomains like <VERSION>.<APP-ID>.appspot.com, e.g.:

More details at How Requests are Routed.

Overall it would be unnecessary complicated & unreliable.

But you can have multiple AppEngine projects for a single Google Billing Profile. That is what your are probably looking for.

You can also deploy multiple "applications" as different services/modules of the same GAE app - quite a legitimate use. Same sharing note as above applies, but the services don't have to be otherwise related or communicate with each-other (but they can, if you wish).

Dan Cornilescu
  • 39,470
  • 12
  • 57
  • 97
Alexander Trakhimenok
  • 6,019
  • 2
  • 27
  • 52