Short answer: for a small SaaS handling user uploads and database dumps, the storage comparison is only meaningful after a tenant-scoped restore test passes. The useful question is whether one tenant's backup can be located, authenticated, restored, and deleted without crossing another tenant's boundary.
That is the constraint I would put into a notebook before wiring production jobs. An AI application already needs eval-driven checks and prompt-cost awareness; backup code deserves the same treatment. A green upload test does not prove that a restore of tenant acme-eu cannot accidentally select bright-labs data.
The object key is not the policy.
A restore request is a security boundary
The first failure mode is deceptively ordinary: a restore job receives a valid backup ID, lists a broad prefix, and trusts the first matching object. That can restore the wrong tenant while every storage request still returns a successful response. A private bucket does not repair an authorization decision made in application code.
I make the negative case explicit in the eval harness: a cross-tenant read must produce a deliberate authorization failure, such as HTTP 403, and the job must not write any bytes into the target environment. Then I test a missing backup, a duplicate backup ID, and a retry after a partial download. Three checks. No heroics.
For this scenario, the object key is part of the isolation design. A useful shape is backups/{tenant_id}/{backup_id}/uploads.tar.zst and backups/{tenant_id}/{backup_id}/database.sql.zst. The application manifest should store the logical backup ID, tenant ID, object key, byte count, digest, and completion state. A restore request must supply both tenant and backup ID; a prefix search alone is not an authorization check.
Here is the small, boring model I want in a Python eval harness. It does not pretend to be an S3 client. It makes the decisions around the client explicit, which is where cross-tenant mistakes usually hide.
Start with a recovery contract, then compare storage services against it. The contract should name the data owner, the region selected for the account, the private access path, the retention rule, and the evidence an operator must capture. GDPR is not a label granted by a bucket. The controller's data map, access policy, processor terms, retention decision, and deletion process still have to agree.
For this scenario, the object key is part of the isolation design. A useful shape is backups/{tenant_id}/{backup_id}/uploads.tar.zst and backups/{tenant_id}/{backup_id}/database.sql.zst. The application manifest should store the logical backup ID, tenant ID, object key, byte count, digest, and completion state. A restore request must supply both tenant and backup ID; a prefix search alone is not an authorization check.
Here is the small, boring model I want in an eval harness. It does not pretend to be an S3 client. It makes the decisions around the client explicit, which is where cross-tenant mistakes usually hide.
from dataclasses import dataclass
from hashlib import sha256
@dataclass(frozen=True)
class BackupObject:
tenant_id: str
backup_id: str
kind: str
key: str
digest: str
byte_count: int
def expected_key(tenant_id: str, backup_id: str, kind: str) -> str:
if kind not in {"uploads", "database"}:
raise ValueError("unsupported backup kind")
return f"backups/{tenant_id}/{backup_id}/{kind}.zst"
def verify_restore(requested_tenant: str, item: BackupObject, body: bytes) -> None:
expected = expected_key(requested_tenant, item.backup_id, item.kind)
if item.tenant_id != requested_tenant or item.key != expected:
raise PermissionError("backup is outside the requested tenant")
if len(body) != item.byte_count:
raise ValueError("backup byte count changed")
if sha256(body).hexdigest() != item.digest:
raise ValueError("backup digest changed")
The important checks are tenant equality, an exact key derived from trusted fields, and integrity verification after download. Test them with two tenants and a credential that can read one tenant but not the other. The test should fail closed. Fast failure is fine; a plausible restore from the wrong tenant is not.
How should a small SaaS test GDPR backup restores for user uploads?
Compare the recovery workflow before comparing a storage number. A database dump may download rarely, while user-upload archives can create a large transfer during an incident. Egress, retrieval time, operator steps, and the cost of keeping a second copy belong in the same experiment.
I would make the dataset deliberately modest: one tenant with a database dump, one with an upload archive, and a third tenant whose objects must never appear in either restore. Record selected region, total bytes, elapsed restore time, digest results, and the access identity used. Repeat the run from a clean environment. It is a better signal than a demo upload because it exercises the exact object names the on-call runbook will use, checks the policy at the moment of recovery, and exposes whether an operator needs an undocumented console step, a second credential, or a manual rename before the database and files can be restored together.
The comparison table should therefore look like a test plan:
| Dimension | Pass condition | Failure meaning |
|---|---|---|
| Tenant isolation | A restore request can read only its tenant's exact keys | The key layout or policy is too permissive |
| Region and privacy | The chosen region and bucket policy match the data-handling record | The deployment needs a compliance review |
| Restore | Uploads and the database dump restore into an empty environment | The service is not ready for the stated recovery objective |
| Integrity | Byte count and digest match the manifest | The pipeline cannot prove what it restored |
| Cost model | Storage, transfer, and recovery volume are measured separately | The “cheapest” estimate is incomplete |
Measure the restore, not the brochure.
This is where notebook-to-prod discipline helps. Build the assertions before adding lifecycle rules or a second provider. It is easy to spend more energy on the upload path while the selected snapshot is never proven to be the one restored. The restore contract should be the first reusable component, and the storage adapter should be the replaceable one.
That last distinction matters during an incident. Suppose the manifest says backup b-017 belongs to acme-eu, but the download worker receives a broad prefix and a credential shared by every tenant. The bytes can be internally consistent, the digest can match, and the database can still be the wrong customer's database. A clean-environment restore then creates a false sense of success unless the evaluator checks the tenant identity before download, the exact key after download, and a known tenant marker inside the restored data. This is why the harness needs both positive and negative fixtures: a valid archive proves integrity, while a valid archive for the wrong tenant proves isolation failure. The extra assertions cost little compared with investigating a plausible but incorrect recovery.
I'm not sure a universal cheapest option exists for this workload. Your mileage will vary with restore frequency, archive size, region, and retention. The evidence that resolves the uncertainty is a recorded restore run against the actual data shape, plus current terms for each finalist.
What belongs in the manifest, policy, and deletion record?
The manifest is a governance record, not a convenience table. It should connect a tenant, a backup ID, an exact object key, a digest, a byte count, a creation timestamp, and a completion state. Keep the restore identity and result alongside that record. Those fields let an operator answer what was restored and from where without searching an entire bucket.
Access policy should mirror the same boundary. A job for tenant A should receive only the permissions and key scope required for tenant A's backup work; an administrative restore identity should be separately audited. Keep synthetic tenant names in CI, and make a wrong-tenant object an expected test fixture. That small discipline protects the eval harness from becoming a second source of untested privilege.
Deletion is part of the lifecycle. A tenant deletion request needs a documented retention exception, manifest update, object deletion operation, and evidence that no secondary copy was silently missed. A nightly job that writes correctly but cannot explain its deletion behavior is not a complete GDPR workflow.
When is a private bucket the wrong backup shape?
The catch is that a private bucket is not automatically an immutable archive. This pattern is not suitable when the requirement is WORM retention, object lock, built-in version history, or automatic replication to a second region. Select a storage product and operating process that explicitly supply the required control, and test the control as part of the restore exercise.
It also may be the wrong shape for public media delivery, browser-direct uploads that require self-service CORS configuration, or workloads that need searchable object metadata rather than predictable prefixes. Those are capability boundaries, not reasons to weaken tenant authorization. Keep backups private and give public assets a separate design.
Choose the storage option that passes the tenant-isolation, region, restore, integrity, retention, and operational-access tests for the real SaaS. Treat price as one measured input, not the headline. If immutable retention or automatic cross-region recovery is mandatory, choose a design that has those controls instead of recreating them with application code.
Keep the harness in CI with synthetic tenant data, and run a scheduled restore against a clean environment. The result should produce evidence: selected backup ID, tenant ID, object keys, digests, bytes, elapsed time, and the identity used. Small scope. Clear proof.
Top comments (0)