Same-region replication (SRR) allows you to replicate objects across buckets within the same region in an automatic and asynchronous (near real-time) manner. Operations such as the creation, overwriting, and deletion of objects can be synchronized from a source bucket to destination buckets.

Usage notes

  • Billing

    After SRR is enabled, you are not charged for the traffic that is generated when you use SRR to replicate objects in OSS. Each time an object is synchronized, OSS accumulates the number of requests. However, you are not charged for the requests.

  • Replication time

    In SRR, data is replicated asynchronously. Depending on the amount of data, it can take a few minutes to several hours to replicate data to the destination bucket.

Limits

  • You can configure SRR between two unversioned buckets or two versioned buckets.
  • The versioning status of two buckets between which an SRR rule is configured cannot be changed.
  • You can manage two buckets between which an SRR rule is configured at the same time. Therefore, the object replicated from the source bucket may overwrite the object that has the same name in the destination bucket.

Enable SRR

  1. Log on to the OSS console.
  2. In the left-side navigation pane, click Buckets. On the page that appears, click the name of the bucket for which you want to enable SRR.
  3. In the left-side navigation pane, choose Redundancy for Fault Tolerance > Same-Region Replication.
  4. In the Same-Region Replication section, click Configure.
  5. Click Same-Region Replication.
  6. In the Same-Region Replication panel, configure the parameters described in the following table.
    Parameter Description
    Source Region The region in which the current bucket is located.
    Source Bucket The name of the current bucket.
    Destination Bucket Select the destination bucket to which you want to synchronize data.
    Applied To Select the source data that you want to synchronize.
    • All Files in Source Bucket: OSS synchronizes all objects from the source bucket to the destination bucket.
    • Files with Specified Prefix: OSS synchronizes the objects whose names contain a specified prefix from the source bucket to the destination bucket. You can specify up to 10 prefixes.
    Object Tagging The tags of objects that you want to synchronize to the destination bucket. Objects that have the specified tags are synchronized to the destination bucket. Select Configure Rules and add tags in key-value pairs. You can add up to 10 tags.

    To configure this parameter, make sure that the following conditions are met:

    • Tags are configured for objects. For more information, see Configure object tagging.
    • Versioning is enabled for the source bucket and the destination bucket.
    • The Operations parameter is set to Add/Change.
    Operations Select the operations to synchronize.
    • Add/Change: OSS synchronizes only the added or changed data from the source bucket to the destination bucket.
    • Add/Delete/Change: OSS synchronizes all data changes including the create, overwrite, and delete operations on objects from the source bucket to the destination bucket.
    Replicate Historical Data Specifies whether to synchronize historical data in the source bucket before you enable SRR for the source bucket.
    • Yes: OSS synchronizes historical data to the destination bucket.
      Notice When historical data is synchronized, objects in the source bucket may overwrite objects that have the same names in the destination bucket. To avoid data loss, we recommend that you enable versioning for the source and destination buckets.
    • No: OSS synchronizes only objects that are uploaded or updated after the SRR rule takes effect to the destination bucket.
    KMS-based Encryption If KMS-based encryption is configured for the source objects or destination bucket, you must select KMS-based Encryption and configure the following parameters:
    • CMK ID: The customer master key (CMK) that is used to encrypt the destination object.

      If you want to use a CMK to encrypt objects, you must create a CMK in the same region as the destination bucket in the Key Management Service (KMS) console. For more information, see Create a CMK.

    • RAM Role Name: The RAM role that is authorized to perform KMS-based encryption on the destination object.
      • New RAM Role: A RAM role is created to perform KMS-based encryption on the destination object. The name of the RAM role is in the following format: kms-replication-source bucket name-destination bucket name.
      • AliyunOSSRole: The AliyunOSSRole role is used to perform KMS-based encryption on the destination object. If the AliyunOSSRole role does not exist, OSS automatically creates the AliyunOSSRole role when you select this option.
    Note You can use HeadObject to query the encryption status of the source object and use GetBucketEncryption to query the encryption state of the destination bucket.
  7. Click OK.
    • An SRR rule cannot be edited or deleted after it is created.
    • The synchronization starts immediately after an SRR rule is configured. You can view the synchronization progress on the Same-Region Replication page.
    • It can take several minutes to several hours for the data to be synchronized to the destination bucket based on the amount of data.

Disable SRR

You can click Disable to disable SRR.

sync

After you disable SRR, the replicated data is stored in the destination bucket. However, the incremental data in the source bucket is not synchronized to the destination bucket any more.