Persistent disc on VM vs managed databases for Kubernetes cluster

10/22/2018

Migrating a Postgres database from Heroku to Google Cloud in a Kubernetes and Docker setup.

Trying to decide what is a better approach.

1st approach - Use a persistent disc on the VM that is used by a deployed Postgres instance in the Kubernetes cluster.

2nd approach - Use a managed Postgres SQL database that the cluster deployments connect to.

I assume the main differences would be for the maintenance and updating of the database? Are there any big trade-offs of one setup vs the other?

-- George Lovegrove
database
google-cloud-datastore
google-cloud-platform
google-kubernetes-engine
kubernetes

1 Answer

10/22/2018

This is an opinion question so I'll answer with an option.

  1. Kubernetes Postgres

    • Pros:
      • You can manage your own Postgres cluster.
      • No vendor lock-in.
      • Postgres is local to your cluster. (It may not be too much of a difference)
      • Do your own maintenance.
      • Raw cost is less.
    • Cons:
      • If you run into any Postgres cluster problems you are responsible to fix them.
      • You have to manage your own storage
      • No vendor lock-in but you still need to move the data if you decide to switch providers.
      • You have to do your own backups.
  2. Managed postgres SQL database

    • Pros:

      • GCP does it all for you
      • Any problems will be handled by GCP
      • Maintenance also handled by GCP.
      • Storage handled by GCP.
      • Backups performed by GCP
    • Cons:

      • Vendor lock-in
      • Postgres not local to your cluster.
      • Will probably cost more.
-- Rico
Source: StackOverflow