Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does it make sense to use one shared Cloud SQL for three separate App Engine project?

I am building a backend for an application with Google App Engine and Cloud SQL.

I do have:

  • A webserver as a proxy in front of my API server which handles sessions (using Cloud SQL and memcache) and calls the API
  • An API server which has access to the resource in the Cloud SQL instance
  • oAuth server which also needs Cloud SQL and memcache for tokens etc.

So my questions: Do I need three Cloud SQL project, which all have their own replica? Or is it ok to have one Cloud SQL project and all three App Engine projects access this Cloud SQL instance through the Cloud SQL proxy?

All projects will be located in the us-central region.

Would love to hear some thoughts.

Thanks!

like image 220
MKS Avatar asked Nov 25 '25 11:11

MKS


1 Answers

I’m adding this information as a formal answer for the community. All credit goes to Dan Cornilescu.

You do not need to create 3 different projects. You can have 3 Google App Engine services running and a single Cloud SQL instance in the same project. That seems to be the best option for your situation. Using multiple services within a single project has its advantages one of them being increased performance.

Note that you could also have multiple Cloud SQL instances running in the same project. You can follow this document that talks more about creating a Cloud SQL instance:

Creating Instances

In case you need more information about Google App Engine services, this is a good resource:

Microservices Architecture on Google App Engine

like image 175
David Avatar answered Nov 27 '25 02:11

David



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!