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 replication between buckets in the same region
    You can configure SRR rules to replicate data from a 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 a 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.

  • Near real-time replication of data

    You can configure CRR rules to monitor data that is added, removed, or modified in near real time and synchronize these changes to a destination bucket. This ensures data consistency between the source and destination buckets.

  • Historical data migration

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

  • Display of the replication progress

    You can view the most recent replication time for the replicated data and the progress of the replication 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 replicate only the added and modified data, delete operations performed on the specified version of an object in the source bucket are not replicated to the destination bucket. However, the delete markers created in the source bucket are replicated 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 that are performed on objects. For more information, see Query real-time logs.

Usage notes

  • Billing rule
    After SRR is enabled, you are not charged for the traffic that is generated when you use SRR to replicate objects from a source bucket to a destination bucket in OSS. Each time an object is replicated, OSS accumulates the number of requests. However, you are not charged for the requests.
    Note The traffic generated when you use SRR does not consume the default bandwidth of OSS.
  • 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 a source bucket cannot be replicated to a destination bucket.
  • Appendable objects in a source bucket cannot be replicated 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 tree, choose Data Management > Same Region Replication.
  4. On the Same-Region Replication page, click Same-Region Replication.
  5. In the Same-Region Replication panel, configure the parameters. The following table describes the parameters.
    ParameterDescription
    Destination BucketSpecify the destination bucket to which you want to replicate data.
    Objects to ReplicateSelect the objects that you want to replicate.
    • All Files in Source Bucket: OSS replicates all objects from the source bucket to the destination bucket.
    • Files with Specified Prefix: OSS replicates the objects whose names contain a specified prefix from the source bucket to the destination bucket. You can specify up to 10 prefixes.
    Object TaggingSpecify the tags of the objects that you want to replicate to the destination bucket. Objects that have the specified tags are replicated 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 the Australia (Sydney) region.
    • Versioning is enabled for the source and destination buckets.
    • The Replication Policy parameter is set to Add/Change.
    Replication PolicyConfigure the data replication mode.
    • Add/Change: OSS replicates only the added or changed data from the source bucket to the destination bucket.
    • Add/Delete/Change: OSS replicates all data changes including the create, overwrite, and delete operations on objects from the source bucket to the destination bucket.
    Replicate Historical DataSpecify whether to replicate historical data in the source bucket to the destination bucket before you enable SRR for the source bucket.
    • Yes: Historical data is replicated to the destination bucket.
      Important When historical data is replicated, objects in the source bucket may overwrite objects that have the same names in the destination bucket. To prevent data loss, we recommend that you enable versioning for the source and destination buckets.
    • No: OSS replicates only objects that are uploaded or updated after the SRR rule takes effect to the destination bucket.
    Replicate Objects Encrypted based on KMSIf KMS-based encryption is configured for the source objects or destination objects, you must select Yes and configure the following parameters:
    • CMK ID: The customer master key (CMK) that is used to encrypt the destination objects.

      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 state of the source object and use GetBucketEncryption to query the encryption state of the destination bucket.
  6. Click OK.
    • An SRR rule cannot be edited or deleted after it is created.
    • The replication starts immediately after an SRR rule is configured. You can view the replication progress on the Same-Region Replication page.
    • It can take several minutes to several hours for the data to be replicated to the destination bucket based on the amount of data.

Use RESTful APIs

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.

FAQ

Can I disable SRR after I enabled it for a bucket?

Yes. You can click Disable Replication in the Actions column to disable SRR.

After you disable SRR, the replicated data is stored in the destination bucket. The incremental data in the source bucket is not replicated to the destination bucket.

If the destination bucket uses KMS to encrypt data, am I charged for the encryption algorithm operations?

If the destination bucket uses KMS to encrypt data, you are charged for the encryption algorithm operations. For more information, see Billing of KMS.