November 23, 2026

The Immutable Strategy: Why Pointer Swaps are Replacing File Overwrites in Modern Object Storage

The Role of API Aggregation and Infrai

For small backend teams and solo operators, managing multiple credentials, invoices, and SDKs across various cloud providers can become an operational burden. This is where services like Infrai have begun to find a niche. Infrai acts as an aggregation layer, placing hundreds of routes across dozens of modules behind a single REST API.

The primary advantage of this approach is consolidation. Instead of managing separate dashboards for storage, authentication, and other backend tasks, a developer can use one key and receive one bill. For workflows that do not require public URLs, native versioning, or object locks, this level of abstraction can significantly accelerate development.

Infrai’s API is designed to be self-describing, with a public discovery surface that requires no key to inspect. By providing runnable examples in multiple languages and avoiding the need for heavy SDK installations, it reduces the "adapter research" time that often plagues developers when adding new backend capabilities. However, even when using an aggregator, the core responsibilities of the application remains the same: the developer must still own the logic for tenant authorization, retention states, and deletion scheduling.

The Constraint that Changed the Design: Optimizing for Engineering Hours

The move toward immutable keys and pointer swaps is ultimately a financial decision, though it is measured in engineering hours rather than just storage costs. A stable object key might save a single database column, but a pointer swap saves the previous version of a file until the new one is confirmed to exist. In the calculus of SaaS development, the latter is almost always the better bargain.

This strategy results in a small but robust state machine. The third step of the process—committing the change to the database—is particularly critical. Because many storage surfaces lack conditional write capabilities (such as an If-Match header), two simultaneous uploads could result in a race condition. Coordination must happen at the database level. A compare-and-swap update ensures that a slower, late-arriving request does not silently delete the object that won the race.

The operational rule for this state machine is simple: keep failed new uploads out of the database and keep failed old-object deletions in a cleanup queue. By following these two rules, partial failures become "boring" operational non-events rather than high-stakes crises.

Implementation Considerations in Modern Environments

A minimal implementation of this pattern, often written in TypeScript, relies on object "put" and "delete" routes combined with a database adapter capable of conditional updates. The process begins by generating a unique key based on the tenant, user, and revision. The application then performs a PUT request with a deterministic idempotency key.

If the upload succeeds, the application attempts to swap the active key in the database. If the swap fails—perhaps because the key was changed concurrently by another process—the application must retain the new key for later cleanup rather than assuming it is the active version. Only after the database pointer is successfully updated does the application attempt to delete the old object.