Skip to main content

Databases in CGC: how it works

CGC lets you run databases (PostgreSQL, PG-Vector, Apache AGE, Weaviate, MinIO) as containers inside your namespace with cgc db create.

CGC provides you with the ability to spawn various databases that are accessible inside of your namespace. Databases are spawned as containers, same as compute resources.

The url column of cgc db list is only reachable for the databases that speak HTTP (MinIO, Weaviate); PostgreSQL, PG-Vector and Apache AGE are not published through ingress, so connect to them from inside your namespace by name (<name>:<port>).

Be mindful in choosing the right values for your CPU and RAM, as databases are meant to run for long periods of time without interruptions. Always create a database with a mounted volume (-v), otherwise its data lives on the pod's ephemeral disk and is lost on every restart. Of course you can stop the db and restart it with the same mounted volume, to start where you ended before.

Other databases

Not all databases are possible to include in the CGC catalog. If you want to use another database, you can do it by using your own image. Instructions are here.

cgc db create --help also lists mongodb and redis, but neither can be created that way: the licence does not allow CGC to serve them as single click apps and the command creates nothing. If you need them, run them from the official image with cgc compute create custom, see MongoDB and Redis.