pinoyyid
pinoyyid

Reputation: 22306

Can I mix programming languages in a single appengine project?

I have an existing Java Appengine standard project. I'm writing some new functionality using the beta NodeJS standard environment. The two need to share a common Cloud Datastore database.

Can a single project host both a Java and Node service? If not, how can I share the database between projects?

Upvotes: 2

Views: 993

Answers (2)

Steren
Steren

Reputation: 7919

Yes, a single GCP project can host many App Engine "services", each of these services can be written in a different programming language and use a different environment (Standard or Flexible).

Within one GCP project, you can have:

  • Many services per GCP project
  • Many versions per service

By default, deployments go to the default service, to deploy to a different service, use service: my-service in your app.yaml file. Read more about how you can structure apps and organize your files on this page.

Basically, any deployed App Engine "version" is independent from the other deployed "versions". For example, within one service, you could have the first version running Java, and the next version running Node.js.

Upvotes: 3

Dan Cornilescu
Dan Cornilescu

Reputation: 39824

Yes, you can have any mix of standard and flexible environment services, written in any languages, see also:

You don't have to do anything special to share the datastore, it's automatically shared by all app's services.

But you may need to pay extra care to keep the datastore index definitions coherent across all services (the datastore index configuration is an app-level configuration, not a service-level one). See also: Do I need to define datastore-indexes in every microservice(module) which uses it or just in root application?

Upvotes: 1

Related Questions