Use single database in two different region application in google app engine

59 views
Skip to first unread message

vaishnavesh shukla

unread,
Nov 24, 2016, 2:53:44 AM11/24/16
to Google App Engine
I created two applications in different region in google app engine and want to use a single database for both applications. I created one database with second generation type (also have first generation type database). I am able to use this database in one of my application and not able to use it in another application. Please help me to use it in another application.

First application with database
region:  us-east1 
Database :
Instance : Instance connection name
inteladgence-east-new:us-east1:inteladgence-db-master

2nd Application which will use first application database
Region: us-europe

Vitaly Bogomolov

unread,
Nov 25, 2016, 12:49:56 AM11/25/16
to Google App Engine
I created two applications in different region in google app engine and want to use a single database for both applications. I created one database with second generation type (also have first generation type database). I am able to use this database in one of my application and not able to use it in another application. Please help me to use it in another application.

for example.

you can implement third app with your shared database. this app must implement REST interface for requests to databases from any external apps (include your two existing apps).

Alex (Cloud Platform Support)

unread,
Nov 25, 2016, 12:07:54 PM11/25/16
to Google App Engine

Hi Vaishnavesh,


As another solution, you need to verify that your two applications are on the same project as the database. If they are, then you shouldn’t have any problem connecting your second application to the same database and so you can follow these steps to do it. If they are not, then you can follow the following steps(as also described here) to authorize your app in another project:


  1. Go to the IAM & Admin Service accounts page.

  2. Select the project that has your App Engine application.

  3. Find App Engine default service account and copy the email address under it (xx...@appspot.gserviceaccount.com).

  4. Using the top left project menu, return to the project that contains this SQL instance.

  5. Click Add Member, enter the email address as the member, and choose Editor as the role. Then click Add.


Let me know if that works for you and if not, I would need you to provide the following additional information to help you further:


  1. Are the two applications on separate projects?

  2. Provide a minimal working example of your code as described here, showing how you connect to your database from each of the App Engine applications.
Reply all
Reply to author
Forward
0 new messages