Meekaa Saangoo
Meekaa Saangoo

Reputation: 349

PostgresQL data_directory on Google Cloud Storage, possible?

I am new to google cloud and was wondering if it is possible to run PostgresQL container on Cloud Run but the data_directory of PostgresQL was pointed to Cloud Storage?

If possible, then please could you point me to some tutorials/guides on this topic. And also what are the downsides of this approach?

Edit-0: Just to clarify what I am trying to achieve:

I am learning google cloud and want to write simple application to work along with it. I have decided that the backend code will run as a container under Cloud Run and the persistent data(i.e the database file) will reside on Cloud Storage. Because this is a small app for learning purpose, I am trying to use as less moving parts as possible on the backend(and also ones that are always free). And also both PostgresQL and the backend code will reside in the same container except for the actual data file, which will reside under Cloud Storage. Is this approach correct? Are there better approaches to achieve the same minimalism?

Edit-1: Okay, I got the answer! The Google documentation here mentions the following:

"Don't run a database over Cloud Storage FUSE!"

Upvotes: 0

Views: 1056

Answers (1)

Enrique Del Valle
Enrique Del Valle

Reputation: 520

The buckets are not meant to store database information, some of the limits are the following:

There is no limit to writes across multiple objects, which includes uploading, updating, and deleting objects. Buckets initially support roughly 1000 writes per second and then scale as needed.

There is no limit to reads of objects in a bucket, which includes reading object data, reading object metadata, and listing objects. Buckets initially support roughly 5000 object reads per second and then scale as needed.

One alternative to separate persistent disk for your PostgreSQL database, is to use Google Compute Engine. You can follow the “How to Set Up a New Persistent Disk for PostgreSQL Data” Community Tutorial.

Upvotes: 1

Related Questions