DEV Community

GregorSterling9652
GregorSterling9652

Posted on

Large File Backup Storage for SaaS User Uploads and Database Dumps Under GDPR

Experiment note

Short answer: for a small European SaaS that processes receipts, private S3-compatible object storage is usually the lowest-friction backup target for large files and database dumps, provided the restore path does not require immutable retention or built-in cross-region replication. The choice is about sustained throughput and recoverability, not a tiny difference in storage price.

I started with the simple design: stream every receipt and SQL dump through the application server, then write one object per job. It looked easy. It also made the web process the bottleneck, so a busy upload hour competed with backup traffic. The replacement is a queue-backed worker: uploads land in a private bucket, the worker batches database dumps, and both paths record a checksum and object key in the application database. That separation keeps large-file throughput measurable.

For a concrete test, use a 4.8 GB compressed receipt export and a 620 MB PostgreSQL dump. Run the export three times in an EU region, then restore it into a disposable account. Record upload wall time, worker memory, retry count, bytes transferred, and restore time. A result that is fast only on upload is not a backup result.

Measure twice.

The useful test is a little more involved than timing one command. Pin the worker's CPU and memory limits, warm the source disk once, and then run cold and warm trials separately. Capture the first-byte latency as well as total duration, because a queue that starts quickly but stalls on the final parts feels different from one with a slow start. Add an intentional network interruption during part three and confirm that only that part is retried. After the upload, compare the manifest's SHA-256 with a fresh download, then delete the staging database and perform a full restore while another receipt batch is arriving. Note the point at which foreground processing starts missing its latency target. Finally, repeat the drill with two jobs targeting adjacent keys and inspect the lease records for overlap. This gives you a throughput number, a contention number, and a recovery signal that a provider's headline rate cannot provide.

How do GDPR backups handle large uploads and database dumps?

Start with region placement. An EU bucket can simplify a data-residency conversation, but it does not by itself make a processing activity GDPR-compliant. Document the processor relationship, access roles, retention period, deletion process, and where encryption keys are held. Article 17 requests also need a way to find and delete a user's files without deleting an unrelated tenant's archive.

Then check the boring defaults: private buckets, blocked anonymous reads, server-side encryption, lifecycle rules, and audit logs. S3 compatibility is useful only when the backup runner uses ordinary operations such as multipart upload, list, head, and delete. Verify the exact behavior in a staging bucket; “S3 compatible” is a family resemblance, not a promise that every conditional header or billing metric matches.

Cost needs a workload model. Storage is the obvious line item, but egress during a restore, request charges for millions of tiny objects, and a second copy can dominate a small service's bill. Keep receipts in reasonably sized archives when the audit process permits it. A directory full of 10 KB fragments is expensive to list and painful to restore.

The throughput design

Use immutable-looking keys even when the storage system cannot enforce immutability: tenant/acct_42/receipts/2026-08-17/export-001.tar.zst and tenant/acct_42/db/2026-08-17/postgres.dump.zst. Write a manifest beside each archive with byte length, SHA-256, source database position, and creation timestamp. The manifest gives the restore job something concrete to validate before it replaces data.

Large objects should use multipart upload. Parts let a worker retry one failed transfer instead of restarting a 4.8 GB object, and they make concurrency a tunable parameter. Start with four workers and 64 MiB parts, then measure. More parallelism can saturate the network while starving receipt processing; less can leave the link idle. Your mileage may vary with the region and the backup runner's disk.

Here is the shape of a worker boundary in TypeScript. The interface is deliberately generic so the same test can run against several S3-compatible implementations.

type Archive = { key: string; bytes: number; sha256: string };

interface ObjectStore {
  putMultipart(key: string, sourcePath: string, partSize: number): Promise<void>;
  head(key: string): Promise<{ bytes: number; etag?: string }>;
  removeBatch(keys: string[]): Promise<void>;
}

async function publish(store: ObjectStore, archive: Archive, path: string) {
  await store.putMultipart(archive.key, path, 64 * 1024 * 1024);
  const remote = await store.head(archive.key);
  if (remote.bytes !== archive.bytes) throw new Error("archive length mismatch");
}
Enter fullscreen mode Exit fullscreen mode

The database is the coordination point. Give each backup a unique key, mark it writing, ready, or expired, and have the worker claim a job before uploading. Two jobs must not overwrite the same key: the available evidence for this setup does not include If-Match-style conditional writes. A queue or database lease is the predictable answer.

A lifecycle rule that deletes old objects can reduce storage, then quietly remove the only copy needed for an investigation. Test expiration in a non-production bucket and keep the retention decision in code or configuration under review. Deletion should be a batch operation driven by a manifest, with a report of keys requested and keys confirmed absent.

A private bucket also changes the restore experience. Operators need short-lived signed downloads or a worker that streams directly into the database tool. Never make the archive public to save a minute during an incident. Log who requested a restore, which tenant it covered, and when the link expired.

Keep it boring.

Compression is another trade-off. Receipt PDFs and images may already be compressed, so compressing them again burns CPU for little byte reduction. SQL text and JSON metadata usually compress well. Measure both CPU seconds and transferred bytes; the cheapest byte can be the most expensive minute.

When private object storage is the wrong backup system

The catch is that a private bucket is a file store, not a complete compliance archive. It is not suitable when policy requires WORM retention, object lock with legal holds, or provider-managed cross-region backup replication. Choose a backup platform with those controls, or add a separately managed immutable copy, when those requirements are explicit.

It is also a poor fit if restores are frequent and geographically broad: egress and operator time can outweigh the low storage rate. Keep a warm replica or a regional recovery service when the recovery objective demands it.

I am not sure a single “cheapest” answer survives a real restore drill. Prices and network paths change, and a quote that excludes retrieval is incomplete. Make the decision from a 30-day sample: average stored gigabytes, peak upload concurrency, expected restore gigabytes, request count, and the time an engineer spends operating the system.

The decision rule is simple: private object storage fits encrypted, scheduled archives when your team can own manifests, leases, lifecycle tests, and restore drills. Move up to an immutable backup service when the compliance contract says you must.

References

Top comments (0)