Skip to main content
← All posts

Cut over object storage reads with feature flags

November 30, 202610 min read
Best PracticesGeneral UsageTutorial

Changing an S3 endpoint looks like a small configuration update. In a production application it also changes downloads, export jobs, signed URLs, permissions, and objects created while the copy is still running. A finished copy job does not prove those workflows work through the new store.

This post is the RustFS view of that cutover. It is informed by Object Storage Migration with Feature Flags (HU Beau, FeatBit, 2026-11-13), which uses RustFS as the migration target. The wording here is ours. For the mechanics of pulling objects into a RustFS bucket, see On-demand Migration: Pull Objects into RustFS and the on-demand migration documentation.

Split the work into three jobs

Keep these decisions separate:

  1. Copy and verify. Bring objects into a RustFS bucket and confirm that each intended key matches the source content.
  2. Control reads. Use a feature flag to decide which application reads may use a verified RustFS copy.
  3. Transfer writes later. Move authoritative uploads, overwrites, and deletes only after the read path is proven, as its own operation.

The application's catalog remains the business authority for ownership, the active version, and deletion. A deleted document stays unavailable even if a physical copy is still present in either bucket.

Start with immutable, completed objects

Begin with one customer action: downloading a completed object through the application backend, under a unique, immutable key. A revised document gets a new key, and the catalog selects the active version. Uploads, overwrites, and deletes keep writing to the source during this phase.

If keys are overwritten in place, do not apply this pattern until you have a version-aware consistency design. A copy verified yesterday does not establish that today's overwritten object is ready.

Write a short contract before any production traffic uses the new store:

DecisionInitial contractEvidence needed before expansion
Object identityThe catalog supplies a tenant-owned, immutable object keySource and target copies match that object and its content
Read eligibilityOnly completed, verified objects may use RustFSPer-object verification records agree with the catalog
Write authorityThe source remains the only authoritative object writerEvery upload and background writer still follows that route
Business authorityThe catalog controls ownership, active versions, and deletionBoth read paths enforce the same permissions and state
Rollout unitA trusted tenant identifierIncluded and excluded tenants receive the expected policy
RecoveryDisable candidate reads and return subsequent reads to the sourceThe source still holds the objects and access that recovery needs

Object counts or matching filenames are not enough. Validate content with a checksum the source, the target, and the copy tool all support, plus the metadata and response behavior the application depends on.

Fill the bucket before you switch customer reads

On-demand migration can populate a RustFS bucket in two ways: it pulls a missing object from a configured external source when a client reads that key, or it runs a background backfill. The source stays read-only. RustFS does not write or delete objects on the source.

For a verified-read cutover, use backfill to prepare the copies, verify those exact objects, and mark them ready in the catalog before directing customer downloads to RustFS. A GET miss that pulls and serves an unverified object in one step is a way to fill the bucket. It is not a complete readiness gate for production traffic.

After a key is stored locally, on-demand migration does not keep following later changes to that key on the source. A local PUT or DELETE is not written back to the source. Those limits are why the first rollout stays on immutable keys, and why write cutover is a separate plan. Bucket replication and site replication are different features and do not replace this workflow.

Put the flag at the application read boundary

Deploy both storage adapters behind the application's existing download path. Authorize the caller and resolve the document in the catalog before you select a backend. Keep credentials, endpoint selection, and tenant context on the server. A browser parameter must never choose the storage endpoint or grant access to another tenant's object.

A boolean flag such as documents-read-from-target is enough:

  • false selects the source read path. Use this as the off variation and as the application's fallback.
  • true permits the RustFS read path for an assigned tenant, only when that exact object is marked verified.

Evaluate the flag once at the request boundary with a server-side SDK, then pass the result to the read planner. A background job should use one decision for its unit of work, rather than changing storage policy halfway through a download or a batch. If flag evaluation fails, keep the default of false so reads stay on the source while it remains valid.

The FeatBit article includes a worked example with its Node.js SDK and tenant-level targeting. The same split works with another feature-flag control plane: the SDK selects the tenant's policy; application code enforces object readiness; a separate worker copies and verifies objects. The control plane does not copy or checksum the object.

Assign the storage policy by tenant so colleagues do not receive different rollout policies only because they have different user accounts. Tenant assignment answers whether a tenant may use the candidate path. Object readiness answers whether a particular immutable object can use it. A tenant assigned to RustFS can still read a recently created, unverified document from the source. Log both facts. Otherwise a nominal 10% tenant rollout can look healthy while almost every download still uses the original store.

A percentage of tenants is not the same percentage of requests or bytes. One tenant may account for most downloads. Review tenant count, traffic volume, object sizes, and RustFS capacity together when you choose the next stage.

If the application issues presigned URLs, make the routing decision before signing. An already issued URL continues to address its original endpoint until it expires. CDN entries and in-flight transfers need their own recovery handling. For large objects, stream the body with the application's existing limits and cancellation handling, and track completion of the response body as well as the initial storage response.

Expand only with evidence

Begin with a copied test set and internal tenants. Include representative file sizes, Unicode keys, metadata, range reads, and permission cases. Exercise export workers and other callers that bypass the web page.

Use a sequence such as the one below. The percentages are illustrative allocations of eligible tenants, not safety guarantees or a fixed schedule.

StageExposureRequired evidence
PreparationProduction reads remain on the sourceCopies verified; both adapters tested; instrumentation and source recovery rehearsed
Internal validationNamed internal tenantsCorrect documents, permissions, download behavior, and visible RustFS traffic
Small canaryFor example, 1% then 5% of eligible tenantsTarget error rate and latency acceptable; business download completion intact
Broader readsFor example, 25%, 50%, then 100% of eligible tenantsRepresentative sizes and tenants covered; copy lag and capacity remain acceptable
Write cutoverA separate, approved migration operationWrite fencing, reconciliation, and the post-cutover recovery plan are ready

Before each increase, the release owner reviews evidence and records a continue, hold, or return-to-source decision. Choose an observation window that includes enough relevant downloads and the workloads that matter, such as a scheduled export. A quiet five minutes does not validate a nightly job.

Useful signals include download failures by assigned policy and actual backend, end-to-end latency and time to first byte by object size, verification failures or permission violations, the share of verified RustFS reads versus readiness bypasses, copy lag, and successful customer downloads or export jobs relative to attempts. Compare like workloads. A target serving only small cached files cannot establish performance for large exports.

Record the flag key, evaluated variation, assignment unit, actual backend, routing reason, and a migration revision with the relevant telemetry. Do not log document contents, credentials, or signed URLs.

Rehearse returning reads to the source

While the source still owns writes and retains the required objects, disabling candidate reads can return subsequent application reads to the source. Verify that the change propagates across every relevant service, including SDK instances that are still using cached configuration. A flag update does not cancel an active transfer, replace an issued signed URL, or flush a CDN.

Rehearse recovery before inviting production tenants:

  1. Record the current rules, dispatch attribute, variation allocation, and migration revision.
  2. Disable candidate reads and confirm new requests select the source on every relevant service.
  3. Download known objects, recently uploaded documents, and representative large files through the normal customer path.
  4. Check that deleted documents remain unavailable and tenant permissions still hold.
  5. Verify download completion, error rate, and response time after the change.
  6. Keep copy workers and cleanup jobs under their own explicit controls. Switching reads does not stop or reverse them.

During the read migration, a false fallback is appropriate because the source remains valid. Revise that assumption deliberately before you change write ownership or retire the source.

An application may also retry a failed RustFS read against the source when both represent the same authorized, active immutable object and no response bytes have been sent. Treat this as an explicit recovery policy with its own metrics. An automatic retry on every error can hide a broken candidate or amplify an outage. Do not treat an access-denied response as proof that a key is missing: Amazon S3 can return 403 for a missing object when the caller lacks bucket-listing permission.

Treat write cutover as a new consistency boundary

Once RustFS accepts authoritative writes that the source does not receive, returning reads to the source may hide new objects or expose stale state. A feature flag cannot reconstruct those missing writes.

Before transferring write ownership, choose and rehearse the data protocol: a controlled write pause and final reconciliation, a durable change log with idempotent replay, or another method you can prove. If you use dual writes, specify which side owns truth, how partial failures are retried, how ordering and deletes are preserved, and what proves convergence. Two successful SDK calls are not a cross-store transaction.

Fence the old writers before enabling the new owner. Account for service instances with stale configuration, scheduled jobs, upload URLs already issued to clients, incomplete multipart uploads, and external integrations. A rollout flag can coordinate intended behavior, but it is not a distributed lock that prevents stale writers from accepting data.

Document the new recovery boundary explicitly: either the source remains current through a tested synchronization mechanism, or recovery requires reconciliation before reads can return there. Also validate listings, overwrites, deletes, version behavior, and other operations beyond the initial immutable-download scope before declaring the storage migration complete.

Finish the migration and retire its controls

Keep an owner for the migration flag, the readiness records, both storage adapters, and source retention. Record when recovery to the source stops being supported and what takes its place. Confirm that all application and background callers have moved before removing the old credentials and data according to the retention plan.

Once RustFS is the permanent path, deploy code that no longer evaluates the temporary migration flag, verify production behavior, then archive the flag. Preserve the rollout decisions and data reconciliation evidence with the migration record.

A concrete first milestone is enough to start: one verified object, one included tenant, one excluded tenant, and a demonstrated return to the source, before you expand.

Further reading

Amazon S3 is a trademark of Amazon.com, Inc. or its affiliates. FeatBit is a name used by its respective owner. RustFS is not affiliated with, endorsed by, or sponsored by those companies.