Skip to content
HexaTransfer
Back to blog
Cloud & Storage

Multi-Cloud File Management: Avoid Vendor Lock-In

Manage files across multiple cloud providers. Avoid vendor lock-in, optimize costs, and maintain consistent access across platforms.

Multi-cloud file management means storing data across two or more providers (say, AWS S3 plus Cloudflare R2 plus Backblaze B2) behind a single abstraction that treats any of them as a valid home for a given file. The practical payoff is hedge against vendor failures, leverage at contract renewal, and the ability to keep egress costs near zero by picking the right provider per workload. The technical ingredients: an S3-compatible API as the lingua franca, rclone or MinIO Gateway as the portable client, a metadata index (Postgres or DynamoDB-compatible) that records which provider holds each object, and a CI-enforceable inventory of credentials via HashiCorp Vault or AWS Secrets Manager.

What Lock-In Actually Costs

Lock-in is rarely one giant bill — it's a hundred small frictions. Once your code uses aws s3 cp, hardcodes us-east-1, relies on S3 Select, or depends on DynamoDB streams, porting elsewhere means rewriting all of that. Egress fees are the most visible tax: AWS bills $0.09 per GB out for the first 10 TB. Moving 50 TB off AWS costs roughly $4,000 in bandwidth alone, not counting engineer time.

Less obvious: proprietary features like Glacier vault locks, Lambda triggers on S3 events, or IAM Access Analyzer all become migration projects. Multi-cloud isn't about using every cloud for everything — it's about keeping the exit door open so your price and reliability stay honest.

S3-Compatible API as Common Ground

Nearly every object storage provider now speaks S3 API: AWS, Backblaze B2, Cloudflare R2, Wasabi, Google Cloud Storage (with interop mode), Azure Blob (via third-party gateway), and self-hosted MinIO or Ceph RGW. That means one SDK covers them all:

import { S3Client, PutObjectCommand } from '@aws-sdk/client-s3';
const r2 = new S3Client({
  region: 'auto',
  endpoint: 'https://account.r2.cloudflarestorage.com',
  credentials: { accessKeyId, secretAccessKey }
});
await r2.send(new PutObjectCommand({
  Bucket: 'transfers', Key: 'file.zip', Body: stream
}));

Sticking to S3-API subset (PUT, GET, LIST, DELETE, multipart, presigned URLs) gives you full portability. Skip provider-specific calls like s3:GetObjectLegalHold unless you have a plan for that feature on every backend.

Abstracting Providers Behind a Router

Build a tiny router that maps logical paths to physical buckets. In code, it's a function:

interface Store { put(key, stream); get(key); delete(key); }
class MultiCloudRouter implements Store {
  constructor(private index: Index, private stores: Record<string, Store>) {}
  async put(key: string, stream: ReadableStream) {
    const provider = chooseProvider(key);
    await this.stores[provider].put(key, stream);
    await this.index.record(key, provider);
  }
  async get(key: string) {
    const provider = await this.index.lookup(key);
    return this.stores[provider].get(key);
  }
}

chooseProvider can be policy-driven: region affinity, cost tier, replication requirement, or simple round-robin across providers. The index (Postgres table or DynamoDB) is the single source of truth for object location.

Cost Optimization Across Providers

Prices vary wildly:

  • AWS S3 Standard: $0.023 per GB storage, $0.09 per GB egress
  • Cloudflare R2: $0.015 per GB storage, $0 egress
  • Backblaze B2: $0.006 per GB storage, $0.01 per GB egress
  • Wasabi: $0.0069 per GB storage, free egress (up to 1x stored volume per month)
  • AWS S3 Glacier Deep Archive: $0.00099 per GB storage, $0.02 per GB egress + retrieval fees

A smart routing policy:

  • User-facing downloads: R2 (free egress kills competition here)
  • Cold archive: S3 Glacier Deep Archive
  • Regional redundancy: B2 (cheap, reliable, different corporate risk surface from AWS)
  • Compliance copy with long retention: Wasabi with object lock

For a file transfer service moving 50 TB outbound per month, switching egress from S3 to R2 saves $4,500 monthly before you do anything else.

Keeping Data in Sync Across Providers

For critical data you want replicated across providers, use rclone's sync or bisync:

rclone sync r2:transfers b2:transfers-mirror --transfers 16 --checksum

For continuous replication, either AWS S3 Cross-Region Replication (which supports external targets via Lambda) or a queue-based replicator: post every PUT to SQS/Kafka, consumer reads from queue and writes to secondary provider. Eventual consistency, with an RPO of minutes.

Don't replicate everything. Replicate only what you can't recreate: user-uploaded bytes, yes; build artifacts, probably not; analytics logs that exist in your warehouse too, definitely not.

Credential Management Without Footguns

Multi-cloud means more credentials, and leaked credentials are how breaches happen. Two practices:

  • Centralized secret store: HashiCorp Vault, AWS Secrets Manager, or Google Secret Manager. Never commit keys to Git; scan with gitleaks in CI.
  • Short-lived, scoped tokens: prefer STS tokens over permanent access keys. Scope each credential to one bucket and the minimum verbs needed.

Rotate automatically on a 90-day schedule for long-lived keys, 1-hour for STS. Tag every key with owner, purpose, and expiry. Review orphans monthly.

Unified Monitoring and Logging

Observability across providers matters more than within any one of them. Ship all provider access logs to a single sink:

  • S3 Server Access Logs → CloudWatch → OpenSearch
  • R2 access logs → Cloudflare Logpush → S3 → OpenSearch
  • B2 Event Notifications → webhooks → Loki

Unified dashboards show: requests per provider, error rates, p99 latency, egress bytes per bucket, cost accrual in near-real-time. Alert on any single provider exceeding 2x expected daily egress (a good signal for leaked presigned URLs or scraper abuse).

Governance and Compliance Under Multi-Cloud

Multi-cloud multiplies the compliance surface. Every provider needs its own data processing agreement, its own subprocessor review, and its own audit trail. Practical steps:

  • Map each data classification (public, internal, confidential, restricted) to allowed providers
  • Document residency: GDPR Article 44 transfers out of the EU require a valid mechanism (SCCs, adequacy decision). Keep EU-scoped data in R2 EU region or OVH Object Storage.
  • Track subprocessors. When a provider adds a new subprocessor, you may need customer notice under Article 28(2).
  • Replicate audit logs off the primary provider — an AWS incident that takes down CloudTrail shouldn't take your audit history with it.

Building an Exit Plan Before You Need One

A credible exit plan has three parts: an inventory of every dependency, a tested migration script, and a budget for egress. Inventory includes code, IaC (Terraform modules pinned to provider-specific resources), IAM policies, buckets, and any CDN origin config. Migration scripts should be runnable quarterly in dry-run mode so they don't rot. Egress budget: plan for 1.2x your stored volume, since you'll likely reprocess during migration.

Even if you never exit a provider, the existence of a rehearsed plan means contract renewal negotiations carry weight, and an unforeseen price hike or service change doesn't paralyze the team.

HexaTransfer runs on an S3-compatible storage layer specifically to keep provider choice open — a strategy that works equally well for any team moving big files. Try it at hexatransfer.com — free, no account, 10 GB max.

When Multi-Cloud Is Overkill

Multi-cloud isn't free. You pay in engineering complexity, duplicated tooling, and operational surface area. For teams under 10 engineers with a single product, pick one provider, negotiate volume pricing, and invest the saved complexity in the product. Multi-cloud earns its cost once you hit one of three thresholds: compliance requires data residency across jurisdictions, reliability demands provider-level redundancy (not just region), or procurement leverage against a single vendor matters to the business. Below those thresholds, single-cloud with a clean abstraction layer and a documented exit plan is usually the pragmatic choice.

Send large files securely with end-to-end encryption

Transfer files up to 10 GB for free with end-to-end encryption. No account required. Your files are encrypted in your browser before upload — no one else can read them.

Send a file