Short answer: choose the storage design that can prove tenant isolation during downloads, exports, retention, and restore. For a property-management system, that proof matters more than the bucket brand or a low headline rate.
The field guide: four tests before choosing a storage shape
Use these tests as a gate. A design that fails one is not ready for customer data, even if its upload demo looks perfect.
| Test | Pass condition | Design signal |
|---|---|---|
| Identity | Every read maps an authenticated user to exactly one tenant and object record | A database authorization check sits before URL signing |
| Lifecycle | Preview, export, and held record have separate retention rules | Policy is versioned and jobs emit audit events |
| Recovery | A deleted or unavailable primary object can be restored without crossing tenants | Restore rehearsals run with isolated credentials |
| Residency | Primary, replica, logs, and derivatives have declared US/EU placement | Deployment config and contracts name the actual regions |
There are three practical shapes. A shared bucket with tenant-scoped keys is easy to operate when one API owns every access path. A bucket or account per tenant fits contracts that require independent administrators, keys, or deletion proofs, but provisioning and policy counts grow quickly. A primary plus an independently controlled replica fits contractual exports where regeneration is not an acceptable recovery plan. A gateway can sit in front of any shape when one authorization and audit surface is more valuable than direct client access.
Pick the shared shape only when the API is the enforced doorway. Pick stronger administrative separation when a customer can demand it in a contract. The table is a filter, not a ranking.
How do I choose object storage for generated images and user exports?
Start with a record, not a URL. Store the tenant ID, user ID, immutable object key, media type, byte length, creation time, retention class, and content digest in an authorization database. The key may be readable, such as tenants/t_1842/exports/e_9f2/image.webp; a prefix is an index for humans and tools, never an authorization boundary.
The download path is a short chain: authenticated request -> export record -> tenant check -> signer -> object store -> audit event. The signer should receive one canonical key, one method, and a bounded lifetime. Do not trust a bucket name or key supplied by a browser. Do not put the complete signed URL in logs because its query string can carry credentials.
Here is the boundary in TypeScript. The storage client stays behind an interface, which makes cross-tenant tests fast and deterministic.
type ExportRecord = {
objectKey: string;
tenantId: string;
mediaType: string;
expiresAt: Date;
};
interface ObjectStore {
createSignedGet(input: {
key: string;
expiresInSeconds: number;
contentType: string;
}): Promise<string>;
}
async function issueDownloadUrl(
store: ObjectStore,
record: ExportRecord,
actor: { tenantId: string },
): Promise<string> {
if (actor.tenantId !== record.tenantId) {
throw new Error("forbidden");
}
const remaining = Math.floor((record.expiresAt.getTime() - Date.now()) / 1000);
const expiresInSeconds = Math.max(1, Math.min(300, remaining));
return store.createSignedGet({
key: record.objectKey,
expiresInSeconds,
contentType: record.mediaType,
});
}
The comparison is the security control. Signing is just the handoff. A five-minute (300-second) maximum limits exposure, while an object-level revoke list or version delete gives support a response path when a link is reported. Cache headers still need an explicit review: a private response must not become a shared cached response. Teams sometimes skip that review because the URL looks private; the browser and an intermediary cache don't share that assumption.
One more boundary is easy to miss: generation workers. They should receive a tenant-scoped job and write metadata and bytes under the same export ID. Publish ready only after both records exist. A retry needs an idempotency key; otherwise two identical images can acquire different retention decisions and make an audit trail ambiguous.
What retention and backup policy survives a real property workflow?
Treat retention as a state machine. A temporary preview can expire quickly, a customer export can remain until its contract says otherwise, and a regulated record can be frozen by legal hold. Each transition needs an owner, a deletion trigger, and an auditable event. A timestamp embedded in a filename proves none of that.
Backups solve different failures. Object versioning helps recover an accidental overwrite or delete, but it is not automatically an independent backup. Keep at least one copy under separate credentials or administrative control, and test a restore into a quarantine namespace. The test should verify tenant IDs and digests before anything is made downloadable.
The regional question is also larger than a bucket setting. For US and EU customers, document where originals, thumbnails, model outputs, replicas, access logs, and support exports travel. A preview generated in one region and a final export generated in another are two residency events. FedRAMP is a US government authorization program, not a generic secure-storage badge; map its program requirements only when the workload and contract actually fall in scope.
How should teams operate and observe the download path?
Draw the system in words: request -> authorization record -> signer -> object store -> audit event. Every arrow gets a metric and a failure state.
The useful signals are signed-URL issuance, denied reads, object-not-found responses, upload-to-availability latency, bytes by tenant, and restore duration. Alert on a sudden rise in denied reads and on a drop in audit events. A bytes-only dashboard can look healthy while an isolation rule is failing.
Test the policy as a matrix: same-tenant read succeeds; cross-tenant read fails; an expired export cannot mint a fresh URL; a deleted object is not advertised as ready; and a held object survives its ordinary retention job. Add property-based tests for key parsing so t_18 cannot accidentally match t_1842.
Keep caller errors stable. If storage is unavailable, return a retryable application state and do not mint a URL for an unconfirmed object. Record the request ID, tenant ID, object ID, and decision result, but redact URL query strings. These details make an incident searchable without turning logs into another data store.
Short paragraph. Keep it visible.
Limits and when to change the design
The catch is that this approach is not suitable when clients must write directly to storage for hours, when authorization cannot be centralized, or when a tenant requires a provider-specific feature the interface cannot express. Use a narrower gateway, a separate tenant account, or a native policy in those cases, and document which guarantee you gave up. Don't force a shared abstraction across that boundary.
A shared bucket also becomes uncomfortable when customers require independent administrators, independent encryption keys, or deletion proofs. Move to stronger separation before the contract forces a rushed migration. I'm not sure one replication policy can satisfy every jurisdiction; confirm the exact residency and retention obligations with counsel and the storage operator.
The decision rule is operational: select the simplest topology that passes all four isolation tests, then keep running restore and authorization drills as the property workflow changes.
Top comments (0)