Updated on 2024-11-26 GMT+08:00

Cross-Region Replication

To replicate objects from a source bucket to a destination bucket in a different region, you can configure a single cross-region replication rule that is applied to all objects in the bucket, or you can configure multiple rules that are applied to a set of objects based on the prefix.

A cross-region replication rule may not take effect immediately upon its configuration. Accordingly, the objects that this rule is applied to may not be replicated immediately after the rule is configured.

Buckets with WORM enabled do not support cross-region replication.

Scenarios

Cross-region replication provides disaster recovery across regions, catering to your needs for remote backup.

Cross-region replication refers to the process of automatically and asynchronously replicating data from a source bucket in one region to a destination bucket in another region based on the created replication rule. Source and destination buckets must belong to the same account. Replication across accounts is currently not supported.

You can configure a rule to replicate only objects with a specified prefix or replicate all objects in a bucket. Objects replicated to the destination bucket are precise copies of objects in the source bucket. These objects have the same name and metadata, including content, size, last modification time, creator, version ID, user-defined metadata, and ACL. By default, the storage class of an object replica is the same as that of the source object. You can also specify a storage class for the object copy.

Figure 1 Cross-region replication
  • Regulatory compliance

    OBS stores data across AZs that are far apart from each other, but regulatory compliance may require farther distances. Cross-region replication enables you to meet regulatory requirements.

  • Low latency

    The same OBS resources may need to be accessed from different locations. To minimize the access latency, you can use cross-region replication to create object copies in the nearest region.

  • Data replication

    Cross-region replication allows you to easily migrate your data stored in OBS from one region to another.

  • Data backup and disaster recovery

    To ensure data security and availability, you need to create explicit backups for all data written to OBS in the data center of another region, so that secure backups are available if the source data is damaged irrevocably.

  • Ease of maintenance

    You have a compute cluster across regions that analyzes the same collection of objects. You need to maintain object replicas in these regions.

    OBS helps you replicate your service data stored in OBS to a specified region, but Huawei Cloud has no access to your data. You need to ensure the legal compliance of your use of OBS on your own. If your replication involves cross-border transfer, ensure that your use complies with relevant laws and regulations.

Contents Replicated

After the cross-region replication rule is enabled, objects that meet the following conditions are copied to the destination bucket:

  • Newly uploaded objects (excluding objects in the Deep Archive or Archive storage class)
  • Updated objects, for example, objects whose content or ACL information is updated
  • Historical objects in a bucket with Synchronize Existing Objects enabled (excluding objects in the Archive or Deep Archive storage class)

For example, on July 28, you enabled cross-region replication for a source bucket and uploaded objects A and B to the bucket. Objects A and B were synchronously replicated to the destination bucket. On July 29, you uploaded object C to the source bucket. This time, only object C was replicated to the destination bucket. On July 30, you modified object A in the source bucket. Then, only object A was replicated to the destination bucket.

Cross-region replication does not replicate objects encrypted using SSE-C.

Constraints

Bucket version:

  • Currently, only buckets of version 3.0 and later support cross-region replication. The version of a bucket can be viewed in the Basic Information area of the bucket's Overview page on OBS Console.

Status of the source bucket and destination bucket:

  • The source and destination buckets must have the same versioning status.

Functions:

  • If objects in the source bucket are in the Archive, or Deep Archive storage class, they cannot be replicated to the destination bucket.
  • If the region where the destination bucket resides does not support a certain storage class, object replicas will be stored in the standard storage class.
  • OBS currently only supports the replication between one source bucket and one destination bucket. Replication from one source bucket to multiple destination buckets is not supported. The destination bucket can be modified. However, modifying the destination bucket will change the destination bucket of all existing rules.
  • If cross-region replication is enabled, data cannot be added to the end of objects in the source bucket.
  • For a source bucket, you can create only one cross-region replication rule that applies to all objects in the bucket, or you can create a maximum of 100 cross-region replication rules based on object prefixes to replicate only some of the objects.

Time:

  • A cross-region replication rule may not take effect immediately upon its configuration. Accordingly, the objects that this rule is applied to may not be replicated immediately after the rule is configured.

Area:

  • The source and destination buckets must be in two different regions. Data cannot be replicated between buckets in the same region.
  • Before replicating data, ensure that the source and destination regions can have their data replicated from each other. Figure 2 lists the supported regions. "√" indicates that data can be replicated between regions. "x" indicates that data cannot be replicated between regions.
Figure 2 Replication between regions

Synchronization of historical objects:

  • By default, objects uploaded before cross-region replication is enabled are not replicated to the destination bucket unless the function for synchronizing existing objects is enabled.
  • If the function for synchronizing existing objects is enabled, modifying the cross-region replication configuration may cause synchronization failures. Therefore, do not modify the cross-region replication configuration before the synchronization completes.

Versioning:

  • If versioning is enabled or suspended for both the source and destination buckets and cross-region replication is also enabled for both buckets, deleting an object without specifying its version in the source bucket will also delete the object in the destination bucket.
  • For an enabled cross-region replication rule, if you change the versioning status of the destination bucket, the replication of objects will fail. If you want to change the versioning status of the source bucket, delete the replication configuration first, and then make the change.

Access control:

  • The owners of the source and destination buckets must have the read and write permissions to their respective bucket. Otherwise, data cannot be synchronized. If the system does not have the permissions to read the source bucket or write to the destination bucket due to read or write permission errors, objects cannot be replicated successfully, and such replication will not be resumed even if the permission error is rectified.
  • Do not delete or overwrite object replicas in the destination bucket, or modify their ACLs, which may cause inconsistency of latest object versions or permission control settings between the destination bucket and the source bucket.
  • After a replication with Synchronize Existing Objects enabled is complete, if the replication policy keeps unchanged, any ACL changes of source objects will be synchronized to object copies. However, ACL changes of source historical objects will not be synchronized to the copies of historical objects.

Others:

  • Objects in a source bucket can be replicated to only one destination bucket, and cannot be replicated again from the destination bucket to another bucket. For example, bucket A and bucket B are in two different regions. You can replicate data from bucket A to bucket B or the other way round. However, data replicas in either bucket A or bucket B cannot be replicated anymore.
  • If you delete the OBS agency for an enabled cross-region replication rule, the object replication will be in the FAILED status.

Prerequisites

The source bucket version is 3.0 or later, and cross-region replication is available in the region of the source bucket. For details about the support for cross-region replication in each region, search for "cross-region replication" on the Function Overview page.

Ways to Configure Cross-Region Replication

You can use OBS Console, APIs, or obsutil to configure cross-region replication.

Related Operations