<p>Migrating a Postgres database from Heroku to Google Cloud in a Kubernetes and Docker setup.</p>

<p>Trying to decide what is a better approach.</p>

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

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

<p>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?</p>

George Lovegrove
<p>This is an opinion question so I'll answer with an option.</p>

<ol>
<li><p>Kubernetes Postgres</p>

<ul>
<li><strong>Pros:</strong> 

<ul>
<li>You can manage your own Postgres cluster.</li>
<li>No vendor lock-in.</li>
<li>Postgres is local to your cluster. (It may not be too much of a difference)</li>
<li>Do your own maintenance.</li>
<li>Raw cost is less.</li>
</ul></li>
<li><strong>Cons:</strong>

<ul>
<li>If you run into any Postgres cluster problems you are responsible to fix them.</li>
<li>You have to manage your own storage</li>
<li>No vendor lock-in but you still need to move the data if you decide to switch providers.</li>
<li>You have to do your own backups.</li>
</ul></li>
</ul></li>
<li><p>Managed postgres SQL database</p>

<ul>
<li><p><strong>Pros:</strong></p>

<ul>
<li>GCP does it all for you</li>
<li>Any problems will be handled by GCP</li>
<li>Maintenance also handled by GCP.</li>
<li>Storage handled by GCP.</li>
<li>Backups performed by GCP</li>
</ul></li>
<li><p><strong>Cons:</strong></p>

<ul>
<li>Vendor lock-in</li>
<li>Postgres not local to your cluster.</li>
<li>Will probably cost more.</li>
</ul></li>
</ul></li>
</ol>
