Same-region replication (SRR) enables the automatic and asynchronous (near real-time) replication of objects across buckets that are located in the same region. Operations such as the creation, overwriting, and deletion of objects can be synchronized from a source bucket to a destination bucket.

Scenarios

If you cannot transfer data from a country or a region due to compliance requirements of local laws and regulations, you can configure SRR rules to store the replicas of data in the source bucket in multiple destination buckets that are located in the same region as the source bucket. Objects in destination buckets are exact replicas of objects in the source bucket. The objects have the same object names, versioning information, object content, and object metadata such as the creation time, owner, user metadata, and access control lists (ACLs).

Features

SRR supports the following features:

  • Data synchronization between buckets in the same region
    You can configure SRR rules to synchronize data from the source bucket to multiple destination buckets that are located in the same region as the source bucket. By default, you can configure up to 100 SRR rules for a bucket. You can specify the bucket as a source bucket or a destination bucket. 1

    If you want to configure more than 100 SRR rules for a bucket, contact technical support.

  • Real-time data synchronization

    You can configure CRR rules to monitor data that is added, removed, or modified in real time and synchronize these changes to a destination bucket. The operations performed on objects that are smaller than 2 MB are synchronized within minutes to ensure data consistency between the source and destination buckets.

  • Historical data migration

    Historical data can be synchronized from a source bucket to a destination bucket. This way, two identical data replicas are individually stored in the source and destination buckets.

  • Real-time display of the synchronization progress

    You can view the last synchronization time for real-time data synchronization and the progress of the synchronization for historical data migration in percentage.

  • Versioning

    CRR ensures eventual consistency between the data in the source and destination buckets for which versioning is enabled. If you configure a CRR rule to synchronize only the added and modified data, delete operations performed on the specified version of an object in the source bucket are not synchronized to the destination bucket. However, the delete markers created in the source bucket are synchronized to the destination bucket.

  • Replication of encrypted data

    SRR allows you to replicate objects that are not encrypted and objects that are encrypted by using SSE-KMS or SSE-OSS on the OSS server.

  • Event notification and real-time log query

    You can use the following methods to receive notifications when changes are made to objects in source and destination buckets during SRR. These changes include adding, modifying, removing, and overwriting objects.

    • Set the event type to one of the following values in the event notification rule: ObjectReplication:ObjectCreated, ObjectReplication:ObjectRemoved, and ObjectReplication:ObjectModified. For more information, see Overview.
    • Enable real-time log query in the OSS console to obtain the statistics of operations performed on objects. For more information, see Query real-time logs.

Usage notes

  • Billing

    After SRR is enabled, you are not charged for the traffic that is generated when you use SRR to replicate objects from the source bucket to the destination bucket in Object Storage Service (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 in near real time. The time required to replicate data from the source bucket to the destination bucket may be a few minutes to several hours. The replication time varies based on the data size.

Limits

  • You can only configure SRR between two unversioned buckets or two versioned buckets.
  • The versioning status of two buckets between which a CRR rule is configured cannot be changed.
  • If you configure a CRR rule for two buckets, an object replicated from the source bucket may overwrite an object that has the same name in the destination bucket.
  • Cold Archive objects in the source bucket cannot be synchronized to the destination bucket.
  • Appendable objects cannot be synchronized from a source bucket to a destination bucket whose storage class is Cold Archive.

Use the OSS console

  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 Region The region in which the destination bucket is located. The destination region must be the same as the source region.
    Destination Bucket Specifies the destination bucket to which you want to synchronize data.
    Applied To Specifies the source data that you want to synchronize.
    • All Files in Source Bucket: Object Storage Service (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.
    • The source and destination buckets must be all in the China (Hangzhou) region or in the Australia (Sydney) region.
    • Versioning is enabled for the source bucket and the destination bucket.
    • The Operations parameter is set to Add/Change.
    Operations Specifies 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.

Use the RESTful API

If your business requires a high level of customization, you can directly call RESTful APIs. To directly call an API, you must include the signature calculation in your code. For more information, see PutBucketReplication.