Prompt
I'm building a backup product and need reliable file storage underneath. What makes sense?
Latest observation
For a backup product, the storage layer should be judged on a few things: durability, cheap long-term retention, easy metadata lookup, versioning support, and the ability to survive partial failures.
What usually makes sense
1. Object storage is the default best fit
If you’re storing backup chunks, snapshots, or archive blobs, object storage is usually the right choice.
Good options:
- Amazon S3
- Google Cloud Storage
- Azure Blob Storage
- S3-compatible systems like MinIO, Ceph, Wasabi, Backblaze B2
Why it fits:
- High durability
- Cheap at scale
- Designed for large immutable blobs
- Easy to replicate across regions
- Works well with deduplication and chunking
For most backup products, I’d strongly consider:
- S3-compatible API
- Versioning or immutable object policies
- Lifecycle rules for tiering to colder storage
- Server-side encryption
2. Use a database for metadata, not file contents
Keep:
- backup set manifests
- chunk indexes
- file paths
- checksums
- retention policies
- restore mappings
in a database like:
- PostgreSQL for most cases
- possibly CockroachDB or FoundationDB if you need distributed consistency
Do not store large backup data directly in the DB unless your scale is very small.
3. Local disk is only for cache or staging
Use local SSD/HDD for:
- temporary upload buffering
- short-term cache
- dedupe index acceleration
- restore scratch space
But not as the only durable store unless you’re building a very small on-prem product and handling replication yourself.
Architecture that commonly works well
A solid pattern is:
- Client/agent creates chunks
- Chunk store in object storage
- Metadata DB tracks manifests and references
- Index maps files → chunks → backup versions
- Replication policy copies to another bucket/region/account
- Immutable retention for ransomware resistance
Key design choices
Immutable storage
Backup data should usually be treated as append-only or immutable. This helps:
- simplify consistency
- prevent accidental overwrites
- protect against ransomware
- make retention policies safer
Deduplication
If you expect repeated backups of similar data, dedupe can cut costs a lot.
- Chunking + content hashes
- Store chunks once
- Reference them from multiple snapshots
Encryption
You probably want:
- encryption in transit
- encryption at rest
- ideally customer-managed keys or per-tenant keys if enterprise-facing
Multi-region / cross-account protection
For reliable backup software, one copy is not enough. Common best practice:
- primary object store
- secondary copy in another region/account/provider
What I’d recommend by product stage
If you’re early-stage
Use:
- S3
- PostgreSQL
- optional Redis for hot cache
This gets you reliability fast with minimal operational burden.
If you’re building on-prem / self-hosted
Use:
- MinIO or Ceph as the object layer
- PostgreSQL for metadata
- optional local SSD cache
If you need maximum control and lower cost at huge scale
Consider:
- S3-compatible object store, possibly self-managed
- distributed metadata store
- lifecycle policies to cold storage
- dedicated dedupe/index service
What to avoid
- Storing backups as normal files on a single NAS or filesystem without replication
- Using a relational DB as the primary blob store
- Relying on one VM’s disk
- Designing without immutable writes or retention controls
Short answer
If you want something reliable and practical:
Use object storage for backup data and PostgreSQL for metadata.
If you need self-hosted storage, make it S3-compatible.
If you want, I can also recommend a storage architecture based on your expected scale, tenant model, and whether this is cloud-only or self-hosted.