Google CloudSQL - Instance per DB or single instance for all DBs?
Asked Answered
V

1

6

Trying to figure out what would be better:

  1. Multiple instances, one per DB

    or

  2. Single large instance which will hold multiple DBs inside

The scenario is similar to Jira Cloud where each customer has his own Jira Cloud server, with its own DB. Now the question is, will it be better to manage all of the users' DBs in 1 large instance, or to have a DB instance for each customer? What would be the cons and pros for the chosen alternative? The first thing that came to or minds is backup management - Will we be able to recover a specific customer's DB if it resides on the same large instance as all other DBs?

Similar question, but in a different scenario and other requirements - 1-big-google-cloud-sql-instance-2-small-google-cloud-sql-instances-or-1-medium

Vudimir answered 3/4, 2019 at 5:56 Comment(0)
E
3

This answer is based on a personal opinion. It is up to you to decide how you want to build your database. However, it is better to go with multiple smaller Cloud SQL instances as it is also stated in Cloud SQL > Best practices documentation.

PROS of multiple databases

  • It is easier to manage smaller instances rather than big instances. (In documentation provided above)
  • You can choose the region and zone for each database, so if your customers are located in different geographical locations, you can always choose the closest for them zone for the Cloud SQL instance and this way you will reduce the latency.
  • Also if you are planning to have a lot of databases, with a lot of tables in each database and a lot of records in each table, this means that the instance will be huge. Therefore the backup, creating read replicas or fail-over replicas and maintaining them, will take some time after the databases will begin to expand.

Although, I would suggest, if you have multiple databases per user, have them inside one Cloud SQL instance that so you manage one Cloud SQL instance per user. e.g. You have 100 users and User1 has 4 databases, User2 has 6 databases etc. Create 100 Cloud SQL instances instead of having one Cloud SQL instance per databases, otherwise you will end up with a lot of them and it will be hard to manage multiple instances per user.

Enate answered 3/4, 2019 at 7:40 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.