Duoyun Cloud
Back to Blog
tutorials2026-04-16

Alibaba Cloud OSS Cross-Region Replication Setup

Alibaba CloudOSSCross-RegionReplication

Alibaba Cloud OSS Cross-Region Replication Setup

In today's distributed architecture and global business landscape, data security and availability are paramount. Alibaba Cloud OSS Cross-Region Replication (CRR) automatically synchronizes data from a bucket in one region to a bucket in another, enabling disaster recovery, compliance, and proximity-based access. This guide walks you through the complete setup process.

What Is Cross-Region Replication

Cross-Region Replication is an automatic data synchronization feature provided by Alibaba Cloud OSS. When you upload, modify, or delete objects in the source bucket, OSS automatically replicates these operations asynchronously to the destination bucket. It is ideal for:

  • Disaster Recovery: Ensure data can be quickly restored from a backup region during regional outages
  • Compliance: Meet regulatory requirements for maintaining data copies in multiple geographic areas
  • Proximity Access: Replicate data to regions closer to your users for reduced latency
  • Data Migration: Maintain data consistency during business migration processes

Prerequisites

Before configuring CRR, ensure the following requirements are met:

| Requirement | Details | |-------------|---------| | Source & Destination Buckets | Must be in different regions | | Versioning | Both buckets must have versioning enabled | | Account Permissions | OSS admin access (AliyunOSSFullAccess) required | | RAM Role | Cross-region replication service role must be created | | Storage Classes | Standard, IA, and Archive storage are all supported |

Configuration Steps

Step 1: Create Source and Destination Buckets

Create buckets in two different regions. For example, source in China East 1 (Hangzhou) and destination in China North 2 (Beijing):

# Create source bucket using ossutil
ossutil mb oss://src-bucket-hz --region cn-hangzhou

# Create destination bucket
ossutil mb oss://dst-bucket-bj --region cn-beijing

Step 2: Enable Versioning

CRR requires versioning on both source and destination buckets:

# Enable versioning on source bucket
ossutil version oss://src-bucket-hz --enable

# Enable versioning on destination bucket
ossutil version oss://dst-bucket-bj --enable

Note: Versioning cannot be disabled once enabled. Existing objects before enabling versioning are not automatically versioned.

Step 3: Create the CRR Service Role

In the RAM console, create a service role for OSS cross-region replication:

  1. Log in to the RAM console and navigate to "Roles"
  2. Click "Create Role" and select "Alibaba Cloud Service"
  3. Choose "OSS Cross-Region Replication" as the service type
  4. Recommended role name: AliyunOSSCrossRegionReplicationRole
  5. The system automatically attaches the AliyunOSSCrossRegionReplicationPolicy

This policy authorizes OSS to read from the source bucket and write to the destination bucket.

Step 4: Configure Replication Rules

Configure replication rules through the OSS console or API:

  1. Log in to the OSS console and navigate to the source bucket
  2. Select "Data Management" → "Cross-Region Replication"
  3. Click "Create Rule" and configure the following:

| Parameter | Description | Example Value | |-----------|-------------|---------------| | Destination Bucket | Bucket in a different region under the same account | dst-bucket-bj (cn-beijing) | | Sync Historical Data | Whether to replicate existing objects | Yes (recommended for initial setup) | | Sync Scope | Full sync or prefix-based | Prefix-based (e.g., data/) | | Destination Storage Class | Preserve source class or convert | Preserve source type | | Destination Encryption | Preserve source encryption or use KMS | Preserve source encryption |

  1. Review and confirm the configuration

Step 5: Verify Replication

After configuration, upload a test file to the source bucket:

echo "Hello CRR Test" > test.txt
ossutil cp test.txt oss://src-bucket-hz/data/test.txt

Wait a few minutes and check the destination bucket:

ossutil ls oss://dst-bucket-bj/data/

Performance and Pricing

Replication Latency

| Data Size | Expected Latency | |-----------|-----------------| | < 1MB | 1-3 minutes | | 1MB-100MB | 3-10 minutes | | > 100MB | 10+ minutes |

Actual latency depends on network conditions, inter-region distance, and queue load.

Cost Breakdown

| Cost Item | Billing Method | Reference Price (China East 1 → China North 2) | |-----------|---------------|------------------------------------------------| | Replication Traffic | Per GB replicated | ¥0.50/GB | | Destination Requests | Per 10,000 PUT requests | ¥0.01/10K | | Source Requests | Per 10,000 GET requests | ¥0.01/10K | | Storage | Destination bucket storage | Per destination region pricing |

Prices are for reference only. Check Alibaba Cloud official pricing for the latest rates.

Best Practices

  1. Selective Sync: Use prefix filters to sync only critical data and avoid unnecessary traffic costs
  2. Monitoring & Alerts: Configure CloudMonitor alerts for replication latency and failures. For critical data, set alerts when latency exceeds 15 minutes
  3. Lifecycle Management: Configure lifecycle rules on the destination bucket to automatically transition to IA or Archive storage
  4. Bidirectional Replication: For two-way sync, configure CRR rules on both buckets, but avoid circular replication
  5. Version Management: Regularly clean up historical versions to prevent storage cost growth
  6. Encrypted Data: If using KMS encryption, ensure the destination region also has the appropriate KMS key

Common Issues

How to Troubleshoot Replication Failures?

The OSS console's CRR page shows replication status and error details. Common failures include insufficient destination bucket permissions, unavailable KMS keys, and conflicting bucket policies.

Are Delete Operations Replicated?

By default, delete operations are replicated to the destination bucket. However, deleting a specific version of an object in the source bucket does not trigger replication.

Is Cross-Account Replication Supported?

Yes. Through RAM role authorization, data can be replicated to a bucket under a different Alibaba Cloud account.

Conclusion

Alibaba Cloud OSS Cross-Region Replication is an essential tool for building disaster recovery and global data distribution. With properly configured replication rules, you can ensure data security while controlling costs. For enterprises with multi-region business needs, this is a foundational capability.

If you are planning a cross-region data synchronization strategy, Duoyun Cloud as an Alibaba Cloud partner offers exclusive discount pricing and professional technical support to help you reduce cloud costs and accelerate deployment. Contact us today to learn more.

Need Professional Cloud Consulting?

Our cloud architect team will customize the best solution for you — free

Free Consultation

Related Posts

news

China Cloud Market Share and Trends 2026

2026-04-23
news

Alibaba Cloud New Regions Expansion 2026

2026-04-22
optimization

Alibaba Cloud Storage Cost Optimization with IA and Archive

2026-04-22