---
title: "Storage and data"
chapter: "08"
---

# Storage and data

Containers are disposable. Business data is not.

## Persistent storage

PersistentVolumeClaims request storage through a StorageClass. GKE commonly
uses Persistent Disk or Hyperdisk CSI drivers. Zonal volumes live in one zone;
regional persistent disks synchronously replicate across zones where supported.
Filestore provides managed NFS. Cloud Storage FUSE exposes object data through
a file interface for suitable workloads, but object semantics are not a normal
POSIX disk.

## Database decision

Prefer Cloud SQL, AlloyDB, Spanner, Bigtable, Memorystore, Firestore, or another
managed data service when it meets requirements. Running a database in GKE is
reasonable only when Kubernetes portability or special software needs justify
operating replication, patching, backup, failover, and capacity.

## Connection design

Use private connectivity where appropriate. Prefer Workload Identity over key
files. Use connection pooling and bounded concurrency. A thousand new Pods can
become a database outage if every Pod opens many connections.

## Backup

Backup for GKE captures selected Kubernetes resources and persistent volume
data. It does not capture cluster configuration, node pools, or container
images. Preserve infrastructure-as-code and images separately. Restore into a
prepared target cluster and test the full application.

Official source: [Backup for GKE](https://cloud.google.com/kubernetes-engine/docs/add-on/backup-for-gke/concepts/backup-for-gke).
