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

# Storage and data

Choose data services from access pattern, consistency, availability, recovery,
and operations—not from what fits inside a Pod.

## Kubernetes storage

A PersistentVolumeClaim asks for storage through a StorageClass and CSI driver.
EBS provides block storage, usually tied to an Availability Zone. EFS provides
regional shared NFS access. FSx provides managed file systems for specialized
needs. Topology affects where a Pod can restart.

## Managed data is often safer

Use RDS or Aurora for relational transactions, DynamoDB for known key-value
access at large scale, ElastiCache for cache/session acceleration, S3 for
objects, and OpenSearch for supported search/analytics use cases. Keeping a
database outside Kubernetes removes database operations from the cluster but
does not remove connection, backup, scaling, or failover design.

## Backup and recovery

Replication keeps service available; backup lets you return to an earlier good
state. Protect Kubernetes manifests, persistent data, ECR images, secrets,
infrastructure code, DNS, and dependency configuration. AWS Backup and EBS
snapshots cover eligible resources; tools such as Velero can protect Kubernetes
objects. Always run restore tests.

RPO is tolerated data loss in time. RTO is tolerated restoration time. Write
both before choosing the technology.

## Feynman check

Three copies of corrupted data are three corrupted copies. Replication is not a
time machine; backup and point-in-time recovery are.
